Repository navigation
fix(error): name the resolved specifier in unresolved import diagnostics - #11014
Merged
IWANABETHATGUY merged 4 commits intoSep 28, 2026
Merged
Conversation
linyiru
marked this pull request as ready for review
September 28, 2026 03:57
linyiru
requested review from
IWANABETHATGUY,
hyfdev and
shulaoda
as code owners
September 28, 2026 03:57
Merging this PR will not alter performance
Comparing Footnotes
|
✅ Deploy Preview for rolldown-rs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Member
|
I’ll make a few small changes directly on your branch to avoid unnecessary back-and-forth and help move this forward more efficiently.
|
IWANABETHATGUY
approved these changes
Sep 28, 2026
UNRESOLVED_IMPORT recovered the specifier by dropping the first and last character of the import span, on the assumption that those characters were quotes. Const folding keeps the identifier span, so `id` was reported as `''`, `longerName` as `ongerNam`, and a one-character name panicked. Use the specifier that resolution actually used. The span only underlines the import. fixes rolldown#11013
autofix rewrote the fixture strings to single quotes. The diagnostic underline copies that source, so the snapshot has to match or CI fails.
IWANABETHATGUY
enabled auto-merge (squash)
September 28, 2026 08:24
IWANABETHATGUY
force-pushed
the
fix/11013-unresolved-import-specifier
branch
from
September 28, 2026 08:24
b67fb14 to
91abfc5
Compare
Merged
shulaoda
added a commit
that referenced
this pull request
Sep 30, 2026
## [1.2.12] - 2026-09-30 ### 🚀 Features - inline common chunks containing import() and deduplicate shared code in lazy chunks (#11034) by @hyfdev - experimental `inlineCommonChunks` support (#10899) by @hyfdev - dev: ship imported bindings for HMR partial accept (#10856) by @h-a-n-a ### 🐛 Bug Fixes - chunking: re-derive chunk exec orders after the runtime leaves its host chunk (#11005) by @hyfdev - code-splitting: gate member-read init paths on the reading statement (#11039) by @hyfdev - code-splitting: retain initialization paths through re-exported namespaces (#11037) by @hyfdev - dev: reject non-ESM output formats in dev mode (#11038) by @h-a-n-a - dev: align `import.meta.hot.accept` deps with Vite (#10997) by @h-a-n-a - dev: clear the resolver cache when a file is created or deleted (#10986) by @waltuov - error: name the resolved specifier in unresolved import diagnostics (#11014) by @linyiru - make entries-aware chunk merging deterministic (#11002) by @hyfdev - watch: avoid restarting macOS watcher for unchanged paths (#10992) by @sep2 ### 🚜 Refactor - dev: ship the dev runtime entry as one file (#10998) by @h-a-n-a - binding: remove `__internalForcePanic` (#10989) by @IWANABETHATGUY ### 📚 Documentation - fix cloudflare preview builds (#10996) by @sapphi-red - fix build config loader warning (#10994) by @sapphi-red - deps: use Vite 8 (#10993) by @sapphi-red ### ⚡ Performance - dev: only ship rows with dynamic edges in registerGraph (#11019) by @h-a-n-a ### 🧪 Testing - code-splitting: cover more re-exported namespace shapes (#11042) by @hyfdev - webcontainer: cover the WebContainer download fallback in plain Node (#10966) by @shulaoda - dev: pin the runtime entry file layout that Vite serves (#10983) by @h-a-n-a ### ⚙️ Miscellaneous Tasks - pin VOID_API_URL for the docs deploy (#11041) by @shulaoda - opt into the WebContainer smoke test for napi bumps and loader changes (#10967) by @shulaoda - deps: upgrade oxc to 0.152.0 (#11018) by @camc314 - deps: update rust crates (#11012) by @renovate[bot] - deps: update npm packages (#11011) by @renovate[bot] - deps: update crate-ci/typos action to v1.50.3 (#11023) by @renovate[bot] - deps: update test262 submodule for tests (#11022) by @rolldown-guard[bot] - deps: update rollup submodule for tests to v4.63.5 (#11021) by @rolldown-guard[bot] - deps: update dependency vite-plus to v1 (#11017) by @renovate[bot] - deps: update github actions (#11010) by @renovate[bot] - remove `CLAUDE.md` (#10925) by @iiio2 - verify release debug info by matching file IDs (#10988) by @IWANABETHATGUY - deps: update rollup submodule for tests to v4.63.4 (#10940) by @rolldown-guard[bot] ### ❤️ New Contributors * @waltuov made their first contribution in [#10986](#10986) * @linyiru made their first contribution in [#11014](#11014) * @sep2 made their first contribution in [#10992](#10992) Co-authored-by: shulaoda <[email protected]>
This was referenced Oct 9, 2026
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.
fixes #11013
UNRESOLVED_IMPORTbuilt the specifier by dropping the first and last character of the import span, assuming they were quotes around a string literal. Pre-scan const folding replacesimport(id)with a string literal that keeps the identifier's span, so the message sliced the identifier instead of naming the value that failed to resolve. A one-character identifier panicked (byte range starts at 1 but ends at 0).The diagnostic now stores that resolved specifier. The span is only used to underline the import in the original source.
Reproduced on the previous implementation, then confirmed the fixtures fail there and pass with this change:
import(id)whereid = "no-such-pkg-a"''no-such-pkg-aimport(longerName)ongerNamno-such-pkg-bimport("no-such-pkg-c")no-such-pkg-cno-such-pkg-cimport(a)(one character)no-such-pkg-drequire(required)equireno-such-pkg-e`no-such-pkg-f`no-such-pkg-fno-such-pkg-fimport("no-such-" + "pkg-g")no-such-" + "pkg-gno-such-pkg-gimport("no-such-\u0070kg-h")no-such-\u0070kg-hno-such-pkg-himport(missing)wheremissing = "./no-such-file.js"issin./no-such-file.jsThe underline still points at the identifier, template, or expression as written. An escaped literal is named by the decoded specifier resolution used (
p, not the source spelling\u0070).importof a const that points at a real file still bundles that file and emits no warning.Rust integration fixtures are the coverage the testing guide asks for on diagnostics. Existing unresolved-import fixtures still pass.
Prepared with an AI coding tool. The reproduction above was run against the unmodified diagnostic, and the fixtures were checked after the change.