-
Notifications
You must be signed in to change notification settings - Fork 30k
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
process: add source-map support to stack traces #29564
Conversation
Code LGTM with devsnek's comments addressed. I'll also play with this locally a bit and see if it behaves consistently. Thanks for this this is a big usability improvement in core for a lot of our users! (Note this will probably have to be semver-major and with a CITGM run because it changes all errors and some libraries parse them) |
@benjamingr do you think a major is necessary, even though someone will opt in with Open to other people's thinking on this. |
While behind an experimental flag, I’d expect no changes to precipitate a major. |
If it's opt-in via flags I don't think this need to be semver-major. BTW I think it's fine to just use |
Sorry for being unclear: I do not think this needs to be major with the flag but I do eventually think Node.js should turn this on by default and that change should be semver-major. +1 for Joyee's idea of doing
|
fe2171b
to
3ee0717
Compare
@LinusU I'm wondering if you have any feedback, as we start to build this out; I imagine you've bumped into some interesting edge cases building source-map-support. |
8238a97
to
ffddaf1
Compare
This uses SourceMap.js (shipped with V8) and the cache developed in #28960, to add source-map support to stack traces.
How it works:
If you run your program with the flag
--source-map-support
, and a source-map is found and cached for a file, stack traces are annotated with both the original and transpiled source positions:Providing both the original and transpiled source if possible.
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passesThis grows out of continuing conversation here.
And relies on #28960, which I would ideally like to land first.(landed).