-
Notifications
You must be signed in to change notification settings - Fork 29.6k
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
[v20.6] CJS runs repeatedly when there are circular dependencies when loaded by ESM #49497
Comments
There are issues with the current Node 20.6.0 version. See: nodejs/node#49497
Note that this is breaking |
Can someone give a reproducible example? The code from https://github.com/liuxingbaoyu/node-v20.6-bug doesn't show the problem (it throws an error in |
Sorry, I forgot to push the second commit. |
Please try again, thanks! |
This comment was marked as outdated.
This comment was marked as outdated.
A minimal reproduction: // index.mjs
import "./dep.cjs"; // dep.cjs
require("./dep.cjs");
console.log("RUNNING"); Running |
I have a repro. Starting to bisect. |
There are issues with the current Node 20.6.0 version. See: nodejs/node#49497
There are issues with the current Node 20.6.0 version. See: nodejs/node#49497
@targos If it helps, it looks like the problem is that ESM's CJS loader doesn't set this Here probably: node/lib/internal/modules/esm/translators.js Line 326 in 5b31ff1
|
Bug is introduced by #47999 |
There are issues with the current Node 20.6.0 version. See: nodejs/node#49497
There are issues with the current Node 20.6.0 version. See: nodejs/node#49497
There are issues with the current Node 20.6.0 version. See: nodejs/node#49497
There are issues with the current Node 20.6.0 version. See: nodejs/node#49497
In case there is no easy fix, would it be possible to revert that PR? (cc @aduh95) |
Thanks for the ping, I'll have a look |
Fixes #4099 Waiting for nodejs/node#49497 to be released *By submitting this pull request, I confirm that my contribution is made under the terms of the [Wing Cloud Contribution License](https://github.com/winglang/wing/blob/main/CONTRIBUTION_LICENSE.md)*.
For people watching issue this for the error with Babel: we added a workaround in |
nodejs/node#49497 has been fixed and released.
…rosoft#26921)" This reverts commit 874e285.
* My guess is, it's related to this => nodejs/node#49497 * But could be something else. Seems to only happen in 20.6.0
…he v20 range to v20.6.1 because of a known issue with v20.6.0 that we might as well avoid since we are restricting the supported ranges at this point anyway: nodejs/node#49497 BREAKING CHANGE: the minimum supported version for the v20 range of node has been raised slightly to v20.6.1 to avoid a known node bug
Anyone with a Quick fix, or which version is stable? |
v20.6.1 is stable. |
PR-URL: nodejs#49500 Fixes: nodejs#49497 Reviewed-By: Stephen Belanger <admin@stephenbelanger.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Jacob Smith <jacob@frende.me>
Version
v20.6.0
Platform
all
Subsystem
No response
What steps will reproduce the bug?
https://github.com/liuxingbaoyu/node-v20.6-bug
How often does it reproduce? Is there a required condition?
always
What is the expected behavior? Why is that the expected behavior?
What do you see instead?
Additional information
This should be the regression introduced by v20.6.
The text was updated successfully, but these errors were encountered: