Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork32.2k
Description
- Version: v13.8.0
- Platform: Windows 10 64-bit version 1809
- Subsystem: "esm" maybe?
What steps will reproduce the bug?
- Create a new project in
C:\prog\node\genast
- Add "type": "module" in package.json
- Make a "other.js" with some content, like
const thing = "hej"export default thing
- Make "index.js" with the following:
import other from "./other.js"console.log(other)
> node index.jshej
(as expected!)
- Change index.js to:
import other from "C:\\prog\\node\\genast\\other.js"console.log(other)
It errors out with:
internal/modules/run_main.js:54
internalBinding('errors').triggerUncaughtException(
^
Error [ERR_UNSUPPORTED_ESM_URL_SCHEME]: Only file and data URLs are supported by the default ESM loader
at Loader.defaultResolve [as _resolve] (internal/modules/esm/resolve.js:33:11)
at Loader.resolve (internal/modules/esm/loader.js:85:40)
at Loader.getModuleJob (internal/modules/esm/loader.js:188:40)
at ModuleWrap. (internal/modules/esm/module_job.js:42:40)
at link (internal/modules/esm/module_job.js:41:36) {
code: 'ERR_UNSUPPORTED_ESM_URL_SCHEME'
}
Using forward- och backward slashes doesn't make a difference.
How often does it reproduce? Is there a required condition?
100%
What is the expected behavior?
Absolute includes should work the same as relative
What do you see instead?
Additional information
The same issue is seen with both static ES imports and dynamic ES imports.