-
-
Notifications
You must be signed in to change notification settings - Fork 58
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
Resolve source lines for code shipped in electron.asar #70
Comments
I noticed this in the docs:
Does anybody have any good ideas for a workaround? I'm tinkering with raven-js and sentry-cli trying to upload source maps, I haven't gotten it right yet. I noticed a very popular Electron app ships with the source inside their ASAR package unminified... I'm wondering if there's just not yet a good option for catching/reporting exceptions of a shipped ASAR Electron package. Any ideas? |
I also asked about this in a popular electron boilerplate repo: electron-react-boilerplate/electron-react-boilerplate#1560 The core of the difficulty in my project, which is based on that boilerplate, revolves around these facts:
I'm happy to dig into this more if it helps y'all figure this out. I would say a great real-world proof point for this repo would be if you could submit a PR to the electron-react-boilerplate project. It would get Sentry customers via (8k+ stars) and provide a valuable guide of how electron-builder, Webpack, Electron, and Sentry can be used together. |
I made some headway doing this with sentry-cli:
I have to strip and rewrite the path that the end-user will have the app installed at. I got the path by triggering an error in a production build of my app, observing the error notice in the Sentry error (something like "The file file:///Applications/Command%20E.app/Contents/Resources/app.asar/dist/renderer.prod.js.map could not be retrieved") I guess I will have to use sentry-cli to upload source maps multiple times, one for each client path my app could be installed in. I.e. on Windows that error will probably report as C:\Program Files\Whatever, so I will probably have to upload the same source map files to Sentry multiple times to cover all the possible places a user might have installed my app. It would be nice if raven-js (or the future) allowed me to strip the path as the error is sent to Sentry. Is that something that has been considered before? |
Hi @aguynamedben, This issues is specifically about getting source lines files from You'll need to call sentry-cli something like this:
In the Sentry UI under release artifacts you'll see the uploaded files as:
sentry-electron already handles path normalisation so an error in |
@timfish Ahhh, that makes sense. Thanks for the feedback, I'll give it a try today/tonight. Also the "Known Issue" I mentioned from the docs appears to be about crashes in the renderer process, but I'm guessing source maps works for JavaScript errors in the renderer process, which is what I'm mostly interested in. Thanks. |
Is this still the case? I am getting stack traces with files that look like |
@jtbandes if you could open a new bug issue with a reproduction I will look into this. Our tests do test path normalisation across all operating systems but we don't can't test installed apps so maybe there's a case where it's not working. |
Thanks for the quick reply. Actually, it seems like this was caused by this problem, where we were attempting to use |
Sources from the built in Electron JavaScript code cannot be uploaded using sentry-cli as they come supplied in an
electron.asar
archive. This means they can't be displayed in stacktraces:This could be fixed by:
raven-node
code to include adjacent lines in error eventsThe text was updated successfully, but these errors were encountered: