-
Notifications
You must be signed in to change notification settings - Fork 30.1k
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
module: add test for cjs loader with esm flag #27443
Conversation
If the test is failing but should be passing, we could place it in the Did you write the test? If so, any chance you can remove the ISC license boilerplate? We normally expect code contributions to be distributed under the MIT license of Node.js. |
Most of the code in the test comes from the stealthy-require module, which is under the ISC license: I don't know if it's fine to release it under the MIT license, maybe we can get the feedback of the author.. @analog-nico, what do you think? |
I am totally fine with removing the license note. After all it helps the node ecosystem. :) Please put me in CC if you analyze this issue as I may need to update |
A small number of very minor lint failures that will need to be corrected. /home/travis/build/nodejs/node/test/known_issues/test-esm-loader-cache-clearing.js
2:1 error Strings must use singlequote quotes
6:9 error Strings must use singlequote quotes
7:28 error Expected parentheses around arrow function argument arrow-parens
10:9 error Strings must use singlequote quotes You can run the linter locally with |
This test shows the regression introduced in v11.4.0: clearing out the require.cache crashes node when using the `--experimental-modules` flag. Refs: nodejs#25482
Thanks so much for isolating this bug. I've merged this test into the fix branch at #25491. |
@guybedford Any reason not to cherry-pick a3b07f6 into that branch to preserve authorship for @aduh95? (Not sure if they care of not, but might as well if there's no downside.) |
When using the
--experimental-modules
flag with node, the CJS loader crashes sometime aas described in the related issue. I don' t have sufficient background to understand the module loading, but I have managed to isolate the bug and right a test, hoping that would encourages someone with a better background to tackle the issue.I have observed the bug to be triggered by stealthy-require module, but only when the
--experimental-modules
flag is specified, even if no.mjs
are imported. This is going to be a problem when we remove the esm flag as the module has more than 4M weekly download on npm.Refs: #25482
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passes