-
-
Notifications
You must be signed in to change notification settings - Fork 1.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
Node.js + sourcemaps = incorrect code positions in Sentry #1873
Comments
Do you have a repro-case I can use to debug this? I tested source maps quite a lot of time in Sentry using Node and it worked just fine. |
Ok, here is the repo that reproduces the issue (needs Sentry credentials for testing): I think most users don't have this issue because of non-removable comments like this:
These comments get into the minified file, cutting it with newlines. I turned off bundling of external modules in the Webpack config, so I don't get these comments from various modules in my bundle. |
Changes required for your repro to work:
Also because you are using windows locally, you may want to look at this comment – #1857 (comment) (dsn are public, so no need to hide it on my screen :p) |
Closing due to inactivity |
I got this working in my Electron app with So again, I have a main bundle + an external module, both minified.
|
Thanks for the detailed response @o2genum, appreciate it! |
Package + Version
@sentry/browser
4.5.3@sentry/node
4.5.3raven-js
Description
This is more of an issue with Node.js, I guess Sentry for Node should handle in some way.
Node.js wraps source files in an IIFE. A simple example:
And I know why: Node.js wraps javascript sources in an IIFE. This shifts the first line of the file by the length of the wrapper. For example:
example.js
throw new Error("Hello!")
Now run node example.js:
This wrapper shifts the first line of every source file, making stacktrace column positions for the first line incorrect. Which in its turn breaks minified code + Sentry sourcemap processing, and code positions in Sentry are not even close.
I wonder what can be done about this?
The text was updated successfully, but these errors were encountered: