Repository navigation
fix(json, text, bytes modules): keep both default and namespace imports - #18648
Merged
Merged
Conversation
Collaborator
|
Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/63411 |
|
commit: |
Member
|
The REPL is actually working, it’s just not displaying correctly. :) |
Contributor
Author
OK, to clarify, what I mean here is that I can not reproduce this issue on REPL using
Expected: REPL should load |
Base automatically changed from
jlhwung/fix-regenerator-using-declaration
to
main
November 17, 2026 22:48
`import value, * as ns from "./x.json" with { type: "json" }` only
declared the last specifier, so `value` was left as a reference to an
undeclared variable. Both bindings are now declared.
Assisted-by: Claude Fable 5.2
JLHwung
force-pushed
the
jlhwung/fix-x-modules-default-and-namespace
branch
from
November 17, 2026 22:48
8c7e02b to
46d6a37
Compare
nicolo-ribaudo
approved these changes
Nov 18, 2026
Collaborator
|
Backported to 7.x in #18668. |
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.
import value, * as ns from "./x.json" with { type: "json" }In this PR we fix an issue reported by Claude Fable 5.2: Given the input
The JSON module transform generates the output
which will compile successfully but will throw a runtime error: "value is never declared".
The fix is to record the default and namespace identifier separately and add
const ns = { default: value }right after the injected declaration.The REPL reproduction is not available due to #18643.
Assisted-by: Claude Fable 5.2