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
{{ message }}
Repository navigation
doc: confusing support for extensionless ESM #30655
It's documented at the very bottom of the page. Maybe update the example to say something like this? I feel like a lot of people are (like me!) going to run into this when switching to the native ESM loader.
// my-app.js, part of the same example as above
import './startup.js'; // Loaded as ES module because of package.json
++// Requires --es-module-specifier-resolution=node+import './startup'; // Loaded as ES module because of package.json
Activity
azz commentedon Nov 26, 2019
Ah I forgot about
--es-module-specifier-resolution=node. Perhaps worth leaving a link to this flag in that area of the docs?azz commentedon Nov 26, 2019
It's documented at the very bottom of the page. Maybe update the example to say something like this? I feel like a lot of people are (like me!) going to run into this when switching to the native ESM loader.
MylesBorins commentedon Nov 27, 2019
Commented in the PR
TL;DR
Extensionless files, as documented, are different from extensionless specifiers.
extensionless filepath and specifier
/path/to/fileimport './file'filepath with extension and extensionless specifier
/path/to/file.jsimport './file'Alhadis commentedon Dec 7, 2019
I have an extensionless file (which is an executable) failing to be imported, despite
package.jsoncontaining"type": "module":This happens both with static and dynamic imports.
Current Node version: v13.2.0
doc: clarify required flag for extensionless esm
doc: clarify required flag for extensionless esm
doc: clarify required flag for extensionless esm