fix(turbopack): fall back after filtering declaration path aliases - #191
Draft
fireairforce wants to merge 1 commit into
Draft
fix(turbopack): fall back after filtering declaration path aliases#191fireairforce wants to merge 1 commit into
fireairforce wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
When a tsconfig path maps a runtime package import only to
.d.tsfiles, filtering the declarations leaves no candidates. The current conversion turns that intoImportMapping::Ignore, so calling an imported function can emit(void 0)()instead of resolving the package's JavaScript entry.Keep an empty alternatives mapping when declaration filtering removes every candidate. Resolution then falls back to the original package request, while the mapping still preserves its precedence over inherited and broader wildcard entries. Explicitly empty path arrays and other ignore mappings retain their existing behavior.
Validation
Validated through the utoo Pack integration harness:
(void 0) is not a function; the missing-package regression also fails.exports/main, missing-package diagnostics, and unchanged explicit ignore behavior.cargo clippy -p turbopack-resolve --all-targets -- -D warnings --no-depsand Rust formatting checks pass.Public reproduction: https://github.com/fireairforce/turbopack-dts-paths-repro
Companion utoo integration and executable regression tests: utooland/utoo#3344