-
Notifications
You must be signed in to change notification settings - Fork 29.9k
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
No source info available for syntax error caused during dynamic import
#45862
Comments
@nodejs/modules |
If you host those two files locally and open one in Chrome, what does the browser version of this error look like? |
The browser seems to figure out the source position info. This is what I see in the console:
The source position is clickable in the Chrome UI and indeed links to the expected line/column. Strangely to me (though I suspect not to you all), the source position info does not seem to be present at all in the actual |
I'm also getting this error, can't find the cause due to no info:
node 18.x. Can't open execute this in Chrome, since it's a server-side nodejs app with fastify. |
@mariusa ICYI, I imperfectly work around this problem in my project right now like this: If I see a |
@mariusa you need babel config refer my sample poc on it https://github.com/JSDUNIYA/server-side-render-react-app/blob/main/babel.config.js |
Version
v19.2.0
Platform
Darwin chug.lan 21.5.0 Darwin Kernel Version 21.5.0: Tue Apr 26 21:08:29 PDT 2022; root:xnu-8020.121.3~4/RELEASE_ARM64_T8101 arm64
Subsystem
ESM (presumably)
What steps will reproduce the bug?
Make a fresh directory with the two files shown here,
main.mjs
andother.mjs
, and then runmain.mjs
. Here's a convenient script to make the files and then run Node:How often does it reproduce? Is there a required condition?
Consistently reproducible. No conditions required AFAIK.
What is the expected behavior?
Error thrown which contains the usual text that allows for easy identification. The output from this example would be something like this:
or, arguably nicer, something like this:
What do you see instead?
Additional information
I did notice apparently-related issue #17277 and PR #17281, which I would have thought addressed this issue, but I guess not.
The text was updated successfully, but these errors were encountered: