-
Notifications
You must be signed in to change notification settings - Fork 282
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
TS source maps look wrong when throwing Error #316
Comments
Did you try building with sourceMapRegister: false? We use a custom node
source maps solution by default.
…On Mon, 18 Mar 2019 at 18:12, Steven ***@***.***> wrote:
Assigned #316 <#316> to @guybedford
<https://github.com/guybedford>.
—
You are receiving this because you were assigned.
Reply to this email directly, view it on GitHub
<#316 (comment)>, or mute the
thread
<https://github.com/notifications/unsubscribe-auth/AAkiyrBNFG5rbQ1v3sHAL1JWN-Re3sNvks5vX7rogaJpZM4b6Mpy>
.
|
@guybedford This looks good! ncc build index.ts --source-map --no-source-map-register
node dist/index.js Diff@guybedford Why is source map register enabled by default? |
Because ncc stack traces are otherwise completely undecipherable when running in Node.js, and with this register addon we can always know the original file easily from the stack trace without any more work. |
That makes sense for the use case when the user is not generating source maps (default behavior). But when the user explicitly requests source maps, it seems strange. For example, I can't think of a scenario where the user would want to use Was this option ( |
By default, source maps are not generated in So The I'm certainly open to changing things though. |
Closing in favor of #319 |
I got a report from @javivelasco that the source maps looked wrong for errors in Sentry.
Typically, the
.js
+.js.map
can be used by Sentry to show the original line number that the error was thrown instead of the bundled/webpack line number. However, this was not working so I made a small example to reproduce what I believe is the root cause.Steps to reproduce
The most notable difference is the that some of the lines in the stack trace say
.ts
instead of.js
and don't include a full path.Diff
The text was updated successfully, but these errors were encountered: