You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Platform: Linux landau.julian.dotcore.co.il 5.4.60 deps: update openssl to 1.0.1j #1 SMP Fri Aug 21 14:39:48 CDT 2020 x86_64 Intel(R) Core(TM) i7-3770K CPU @ 3.50GHz GenuineIntel GNU/Linux
Subsystem: esm
What steps will reproduce the bug?
The following minimal project will do:
❯ cat package.json
{
"type": "module",
"devDependencies": {
"cross-fetch": "^3.1.4"
}
}
❯ cat index.js
import "cross-fetch/polyfill";
❯ node --experimental-specifier-resolution=node index.js
node:internal/process/esm_loader:74
internalBinding('errors').triggerUncaughtException(
^
Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/home/perrin4869/univapay/cross-fetch-esm/node_modules/cross-fetch/polyfill' imported from /home/perrin4869/univapay/cross-fetch-esm/index.js
Did you mean to import cross-fetch-esm/node_modules/cross-fetch/dist/node-polyfill.js?
at new NodeError (node:internal/errors:363:5)
at finalizeResolution (node:internal/modules/esm/resolve:296:11)
at moduleResolve (node:internal/modules/esm/resolve:742:10)
at Loader.defaultResolve [as _resolve] (node:internal/modules/esm/resolve:853:11)
at Loader.resolve (node:internal/modules/esm/loader:89:40)
at Loader.getModuleJob (node:internal/modules/esm/loader:242:28)
at ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:73:40)
at link (node:internal/modules/esm/module_job:72:36) {
code: 'ERR_MODULE_NOT_FOUND'
}
What is the expected behavior?
Since the module cross-fetch/polyfill loads flawlessly over cjs, and I understand that most cjs modules should load under esm as a default export, I expected the module to load without this error.
What do you see instead?
Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/home/perrin4869/univapay/cross-fetch-esm/node_modules/cross-fetch/polyfill' imported from /home/perrin4869/univapay/cross-fetch-esm/index.js
What steps will reproduce the bug?
The following minimal project will do:
What is the expected behavior?
Since the module
cross-fetch/polyfill
loads flawlessly overcjs
, and I understand that mostcjs
modules should load underesm
as a default export, I expected the module to load without this error.What do you see instead?
Additional information
Related: lquixada/cross-fetch#110
The text was updated successfully, but these errors were encountered: