-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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
Error [ERR_INTERNAL_ASSERTION]: This is caused by either a bug in Node.js or incorrect usage of Node.js internals. #54773
Comments
As it currently stands, your issue lacks enough information to be easily reproduced. Please edit your issue to include additional information, such as specific (minimal) code snippets that will allow this issue to be easily reproduced. |
This issue/PR was marked as stalled, it will be automatically closed in 30 days. If it should remain open, please leave a comment explaining why it should remain open. |
Hey, I've marked this issue as |
@joyeecheung wdyt? Should we replace the node/lib/internal/modules/cjs/loader.js Lines 1377 to 1381 in 0301309
|
That function should only be used if the option is turned on in the first place (otherwise it should’ve gone elsewhere to throw ERR_REQUIRE_ESM instead of going into this function), I am not sure whether that solves anything without more information of the repro |
@Mongsplaatjies can you provide a minimal reproducible example of the code that caused this error? For reference, the failing assertion is: node/lib/internal/modules/esm/loader.js Line 329 in 0debdac
|
I'm able to reproduce thanks to @dgozman with the following script: rm -rf repro
mkdir repro
cd repro
echo 'import "fs"' > imported.ts
node -e 'require("./imported.ts")'
cd ..
rm -rf repro |
PR-URL: #54868 Fixes: #54773 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
PR-URL: #54868 Fixes: #54773 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
PR-URL: #54868 Fixes: #54773 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
PR-URL: nodejs#54868 Fixes: nodejs#54773 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
PR-URL: nodejs#54868 Fixes: nodejs#54773 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
Version
Node.js v22.7.0
Platform
Subsystem
No response
What steps will reproduce the bug?
at assert (node:internal/assert:14:11)
at ModuleLoader.getModuleJobForRequire (node:internal/modules/esm/loader:329:5)
at new ModuleJobSync (node:internal/modules/esm/module_job:313:34)
at ModuleLoader.importSyncForRequire (node:internal/modules/esm/loader:314:11)
at loadESMFromCJS (node:internal/modules/cjs/loader:1381:24)
at Module._compile (node:internal/modules/cjs/loader:1503:5)
at Module._extensions..js (node:internal/modules/cjs/loader:1691:10)
at Module.load (node:internal/modules/cjs/loader:1317:32)
at Module._load (node:internal/modules/cjs/loader:1127:12)
at TracingChannel.traceSync (node:diagnostics_channel:315:14) {
code: 'ERR_INTERNAL_ASSERTION'
}
How often does it reproduce? Is there a required condition?
Fisrt time
What is the expected behavior? Why is that the expected behavior?
What do you see instead?
Additional information
No response
The text was updated successfully, but these errors were encountered: