-
Notifications
You must be signed in to change notification settings - Fork 30.1k
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
ESM Module: ERR_INVALID_PROTOCOL #15374
Comments
Is this related to this issue? |
Linux: > const { resolve } = process.binding('module_wrap'); resolve('/home/arnavion/main.mjs', 'file:///home/')
URL {
href: 'file:///home/arnavion/main.mjs',
origin: 'null',
protocol: 'file:',
username: '',
password: '',
host: '',
hostname: '',
port: '',
pathname: '/home/arnavion/main.mjs',
search: '',
searchParams: URLSearchParams {},
hash: '' } Windows: > const { resolve } = process.binding('module_wrap'); resolve('C:\\main.mjs', 'file://c/')
URL {
href: 'c:\\main.mjs',
origin: 'null',
protocol: 'c:',
username: '',
password: '',
host: '',
hostname: '',
port: '',
pathname: '\\main.mjs',
search: '',
searchParams: URLSearchParams {},
hash: '' } Perhaps the code thinks the leading |
This error code originally landed in a semver-major commit and is used by the ESM implementation. This backport includes the error message and the documentation for the error. I did attempt to write a test for this, but it did not seem possible to catch an exception during import, I was also unable to execute `node --experimental-modules` properly inside of a child_process. I'll dig more into getting a test together, but we should backport this fix in the mean time. Refs: nodejs#14423 Fixes: nodejs#15374
PR at #15389. |
This error code originally landed in a semver-major commit and is used by the ESM implementation. This backport includes the error message and the documentation for the error. I did attempt to write a test for this, but it did not seem possible to catch an exception during import, I was also unable to execute `node --experimental-modules` properly inside of a child_process. I'll dig more into getting a test together, but we should backport this fix in the mean time. Refs: #14423 Fixes: #15374
This error code originally landed in a semver-major commit and is used by the ESM implementation. This backport includes the error message and the documentation for the error. I did attempt to write a test for this, but it did not seem possible to catch an exception during import, I was also unable to execute `node --experimental-modules` properly inside of a child_process. I'll dig more into getting a test together, but we should backport this fix in the mean time. Refs: #14423 Fixes: #15374 PR-URL: #15388 Reviewed-By: Bradley Farias <bradley.meck@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Hi, I still encoutered this error.The following is my test : add.mjs
test.mjs
run output
I am confused , can someone tell me the reason ? Thanks in addvanced. |
@XHMM, 8.5.0 has this issue. You need to wait for a new release. |
@amitport Thanks for reminding , I just thought this has been fixed . |
Fixes: nodejs/node#15374 PR-URL: nodejs/node#15389 Reviewed-By: Bradley Farias <bradley.meck@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Bartosz Sosnowski <bartosz@janeasystems.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com>
Fixes: nodejs/node#15374 PR-URL: nodejs/node#15389 Reviewed-By: Bradley Farias <bradley.meck@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Bartosz Sosnowski <bartosz@janeasystems.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com>
Hi,
First of all, I want to thank you for your wonderful work!
I try to run simple example using es module (which @MylesBorins share on Twitter), but I stuck on error.
At first I updated today to node version 8.5.0. and write this two simple files
helper.mjs
index.mjs
and after running command
node --experimental-modules index.mjs
, I receive errorAdditionally it looks like some problem with NodeErorr module.
I updated node source code and build it locally to test this behavior, and then I receive this error when I try to run this two files
And this how
specifier
,baseUrl
andurl
object looks like inresolveRequestURl.js
module, after I put some console.log.resolveRequestURl.js
result
The text was updated successfully, but these errors were encountered: