Skip to content
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

Invalid source maps cause file system error hiding true error #8808

Open
devongovett opened this issue Feb 2, 2023 · 1 comment
Open

Invalid source maps cause file system error hiding true error #8808

devongovett opened this issue Feb 2, 2023 · 1 comment
Labels

Comments

@devongovett
Copy link
Member

🐛 bug report

If there is a build error, we try to map the error location back to the original source file by following source maps. However, if the file pointed to by the source map doesn't exist (e.g. source map is published to npm but source files are not), then the user gets an unhelpful ENOENT when we try to display the diagnostic.

🤔 Expected Behavior

Ideally we'd fall back to show the original error message without following the source map, but this may not be possible since we remap early (in the JS transformer). Checking if the remapped file actually exists even in non-error cases is likely to have a significant performance impact. Alternatively, we could at least show a message like "run with --no-source-maps" to see the original error message or something.

😯 Current Behavior

Build crashes with an unhelpful error message.

@mischnic
Copy link
Member

mischnic commented Feb 2, 2023

pointed to by the source map doesn't exist (e.g. source map is published to npm but source files are not)

Another situation where that happens: #8392

@mischnic mischnic added the Diagnostics Error messages/diagnostics label Feb 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants