-
Notifications
You must be signed in to change notification settings - Fork 2.6k
fix(js): recognize tsconfig module nodenext as ESM
#32323
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
| Command | Status | Duration | Result |
|---|---|---|---|
nx affected --targets=lint,test,build,e2e,e2e-c... |
❌ Failed | 40m 18s | View ↗ |
nx run-many -t check-imports check-commit check... |
✅ Succeeded | 1m 56s | View ↗ |
nx-cloud record -- nx-cloud conformance:check |
✅ Succeeded | 2s | View ↗ |
nx-cloud record -- nx format:check |
✅ Succeeded | 6s | View ↗ |
nx-cloud record -- nx sync:check |
✅ Succeeded | 5s | View ↗ |
nx documentation |
✅ Succeeded | 3m | View ↗ |
☁️ Nx Cloud last updated this comment at 2025-08-14 03:07:42 UTC
|
Failed check is due to failing test in |
|
Hey @JoshuaCWebDeveloper I'm not sure if this is 100% correct.
|
@Coly010 Good point. Looked at this a bit closer, My new solution passes a format of undefined to |
leosvelperez
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for contributing! Apologies for the delay.
Please rebase the changes and update the call sites (tsc.impl.ts and tsc.batch-impl.ts) to handle the undefined result and avoid providing [undefined] to the updatePackageJson function. Usages should be something like:
const format = determineModuleFormatFromTsConfig(options.tsConfig);
updatePackageJson(
{
...options,
additionalEntryPoints: createEntryPoints(
options.additionalEntryPoints,
context.root
),
format: format ? [format] : undefined,
},
context,
target,
dependencies
);| case ts.ModuleKind.Preserve: | ||
| return 'cjs'; | ||
| case ts.ModuleKind.Node16: | ||
| case ts.ModuleKind.Node18: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add Node20.
|
Should be handled now by: #31508 |
|
This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request. |
Current Behavior
A tsconfig
modulevalue ofnodenextis treated as a CJS format, which produces a warning when built due to it being used in ESM projects.Expected Behavior
A tsconfig
modulevalue ofnodenextis now teated as an ESM format, producing no warning when built.Related Issue(s)
Fixes #31295