-
Notifications
You must be signed in to change notification settings - Fork 29.6k
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
--enable-source-maps causes "TypeError [ERR_INVALID_URL]" in esm/resolve #38790
Comments
Ping @bcoe |
@aduh95 @maxholman acknowledged, although I'm unlikely to have any time to dig into this bug for at least a week. |
Logic in module_job.js assumes detailed stack trace from node_errors.cc which is not populated when --enable-source-maps is set. Fixes nodejs#38790
Logic in module_job.js assumes detailed stack trace from node_errors.cc which is not populated when --enable-source-maps is set. Fixes nodejs#38790
Logic in module_job.js assumes detailed stack trace from node_errors.cc which is not populated when --enable-source-maps is set. Fixes #38790 PR-URL: #39017 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michael Dawson <midawson@redhat.com>
Hi, I am getting this error message. input: './package.json',
code: 'ERR_INVALID_URL' to fix removed |
@saostad could you provide a snippet of code that causes this error? |
Logic in module_job.js assumes detailed stack trace from node_errors.cc which is not populated when --enable-source-maps is set. Fixes #38790 PR-URL: #39017 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michael Dawson <midawson@redhat.com>
Having this issue as well on 16.0.0. Here's the command: Edit: |
What steps will reproduce the bug?
To reproduce:
node index.js
(throws a SyntaxError, this is expected behavior 👍)node --enable-source-maps index.js
(throws TypeError [ERR_INVALID_URL], unexpected behavior 👎)What is the expected behavior?
What do you see instead?
Additional information
A cursory review tracked this to ModuleJob._instantiate in esm/module_job.js.
The code seems to expect a full path as the first element in the array, but when
--enable-source-maps
is on, the stack does not have this path.As a result, the full error message is passed down into
esm/resolve
instead of a pathname, resulting in an Invalid URL.The text was updated successfully, but these errors were encountered: