Name the re-exported module when a re-export is missing#1586
Merged
Conversation
littledivy
force-pushed
the
fix/reexport-error-module
branch
2 times, most recently
from
July 17, 2026 20:02
0a50dd6 to
a6a2260
Compare
`export { x } from "./mod.js"` where "./mod.js" has no export `x` reported
"Could not find export 'x' in module '<re-exporter>'", naming the module
that contains the re-export statement rather than the module that was
supposed to provide the binding. A direct `import { x } from "./mod.js"`
already reported "./mod.js" correctly.
Report the resolved target module and the looked-up name, matching the
direct-import diagnostic.
littledivy
force-pushed
the
fix/reexport-error-module
branch
from
July 17, 2026 20:22
a6a2260 to
68aea43
Compare
saghul
approved these changes
Jul 17, 2026
The module path in the SyntaxError is written into a fixed-size atom buffer (ATOM_GET_STR_BUF_SIZE = 64), so on CI's long absolute build paths the fixture filename is truncated before the distinguishing suffix. The substring assertion on "fixture_reexport_source" therefore failed even though the fix was correct. Assert instead that the re-export error message equals the message from a direct import of the same missing binding. Both name the source module and the same looked-up name, so the messages are identical regardless of path length, which is exactly the behavior the fix guarantees.
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.
export { x } from "./mod.js"where./mod.jsdoes not exportxreported:It named the module containing the re-export statement instead of
./mod.js, the module that was supposed to providex. A directimport { x } from "./mod.js"already named./mod.jscorrectly.import { missing } from "./helper.js"export { missing } from "./helper.js"The indirect export check now reports the resolved target module and the name looked up there, same as the direct import path.
Disclaimer: This is an AI-assisted patch from the v8x project.