-
Notifications
You must be signed in to change notification settings - Fork 30.3k
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: request for 'node:process' is not in cache
#52187
Comments
can you provide a reproducible example without 3rd party dependencies? |
You cat take a look at commit, when imports awaited in Primise.all - there is such strange arror, when they awaited one-by-one there is no such error. |
Here is minimal example on provided branch const hrefs = [
'file:///Users/coderaiser/cloudcmd/test/static.mjs',
'file:///Users/coderaiser/cloudcmd/test/before.mjs',
'file:///Users/coderaiser/cloudcmd/test/server/show-config.js',
'file:///Users/coderaiser/cloudcmd/test/server/modulas.mjs',
'file:///Users/coderaiser/cloudcmd/test/server/env.js',
'file:///Users/coderaiser/cloudcmd/test/rest/copy.mjs',
'file:///Users/coderaiser/cloudcmd/test/rest/config.mjs',
'file:///Users/coderaiser/cloudcmd/test/common/cloudfunc.js',
'file:///Users/coderaiser/cloudcmd/test/client/listeners/get-range.js',
'file:///Users/coderaiser/cloudcmd/test/client/listeners/get-index.js',
'file:///Users/coderaiser/cloudcmd/client/dom/events/event-store.spec.js',
'file:///Users/coderaiser/cloudcmd/static/user-menu.spec.js',
'file:///Users/coderaiser/cloudcmd/common/util.spec.js',
'file:///Users/coderaiser/cloudcmd/common/try-to-promise-all.spec.js',
'file:///Users/coderaiser/cloudcmd/common/entity.spec.js',
'file:///Users/coderaiser/cloudcmd/common/datetime.spec.js',
'file:///Users/coderaiser/cloudcmd/common/cloudfunc.spec.js',
'file:///Users/coderaiser/cloudcmd/common/callbackify.spec.js',
'file:///Users/coderaiser/cloudcmd/common/base64.spec.js',
'file:///Users/coderaiser/cloudcmd/server/validate.spec.mjs',
'file:///Users/coderaiser/cloudcmd/server/user-menu.spec.mjs',
'file:///Users/coderaiser/cloudcmd/server/terminal.spec.mjs',
'file:///Users/coderaiser/cloudcmd/server/route.spec.mjs',
'file:///Users/coderaiser/cloudcmd/server/rest/index.spec.js',
'file:///Users/coderaiser/cloudcmd/server/markdown/index.spec.mjs',
'file:///Users/coderaiser/cloudcmd/server/distribute/log.spec.js',
'file:///Users/coderaiser/cloudcmd/server/distribute/import.spec.mjs',
'file:///Users/coderaiser/cloudcmd/server/distribute/export.spec.mjs'
];
const imports = [];
for (const href of hrefs) {
imports.push(import(href));
}
await Promise.all(imports); You will see: node:internal/modules/esm/module_job:134
this.module.instantiate();
^
Error: request for 'node:process' is not in cache
at ModuleJob._instantiate (node:internal/modules/esm/module_job:134:21)
at async ModuleJob.run (node:internal/modules/esm/module_job:217:5)
at async ModuleLoader.import (node:internal/modules/esm/loader:323:24)
at async Promise.all (index 26)
at async file:///Users/coderaiser/cloudcmd/1.mjs:38:1 {
code: 'ERR_VM_MODULE_LINK_FAILURE'
}
Node.js v20.12.0 If you comment first line in for (const href of hrefs) {
await import(href);
} you will see the reason of a crash, useful error message: import io from 'socket.io';
^^
SyntaxError: The requested module 'socket.io' does not provide an export named 'default'
at ModuleJob._instantiate (node:internal/modules/esm/module_job:134:21)
at async ModuleJob.run (node:internal/modules/esm/module_job:217:5)
at async ModuleLoader.import (node:internal/modules/esm/loader:323:24)
at async file:///Users/coderaiser/cloudcmd/2.mjs:35:5
Node.js v20.12.0 So that is something related to parallel imports and Node's cache. Would be great to see useful error message when everything is crashed. |
@nodejs/loaders |
Node crashes with strange error.
Version
v20.11.1
Platform
Mac Os
Subsystem
node:process
What steps will reproduce the bug?
How often does it reproduce? Is there a required condition?
Always
What is the expected behavior? Why is that the expected behavior?
Expected behavior: no crash
What do you see instead?
Additional information
No response
The text was updated successfully, but these errors were encountered: