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

Javascript Sourcemap upload to sentry.io #16

Open
aheissenberger opened this issue Sep 16, 2017 · 9 comments
Open

Javascript Sourcemap upload to sentry.io #16

aheissenberger opened this issue Sep 16, 2017 · 9 comments

Comments

@aheissenberger
Copy link
Contributor

aheissenberger commented Sep 16, 2017

Are there any plans to support the upload of javascript sourcemaps?
https://docs.sentry.io/clients/javascript/sourcemaps/

I user webpack & uglify on my project and this would help to show the original source code on exceptions

Is not possible at the moment as sentry.io does not support this for node :-(
getsentry/sentry#2632

I tried to upload thru the sentry cli and tested with webpack devtool: 'source-map' and devtool: 'inline-source-map' but nothing worked as this feature is deactivated for node project globally

@arabold
Copy link
Owner

arabold commented Sep 21, 2017

i was looking into source map upload originally but it doesn't seem to be possibly in Sentry yet. It would be a great feature and shouldn't be difficult to implement on the plugin side. However, it would need support by Sentry / raven-node itself. Did you already file a feature request with them?

@aheissenberger
Copy link
Contributor Author

it is on the road map of sentry.io but they have to rewrite part of there code (getsentry/sentry#2632 (comment)) which is now primarily focused on browser based source maps

@anglinb
Copy link

anglinb commented Jan 14, 2018

👋 Seems like Node source maps are now supported experimentally. I'm going to be playing around with this and will shoot over a PR if I get something working.

@esetnik
Copy link

esetnik commented Apr 25, 2019

I implemented an experimental branch supporting sourcemap uploads here https://github.com/esetnik/serverless-sentry-plugin/tree/feature/sourcemaps. It's currently working for my project setup and I'd be happy to PR it after it gets some testing by others. In order to activate sourcemap upload in my branch you need to pass uploadSourcemaps: true in the plugin configs.

@esetnik
Copy link

esetnik commented Apr 25, 2019

The downside is that there doesn't appear to be any way to upload sourcemaps in bulk (at least I can't find a sentry api for it) so each one is uploaded manually. This means it can take quite a long time if you include node_modules. I've seen sentry's servers fail several times during the upload process. I tried to implement some rate limiting but I have no idea what their rules are so I'm just guessing.

@aheissenberger
Copy link
Contributor Author

aheissenberger commented Apr 25, 2019

@esetnik Have a look at my fork https://github.com/aheissenberger/serverless-sentry-plugin/tree/feature/upload-sourcemaps

which supports uploads with sentry-cli and the new Sentry Unified Node.js SDK.
Sourcemaps need to be part of the zip created for upload to AWS.

I use serverless-webpack which leads to only 2 files per handler.

@esetnik
Copy link

esetnik commented Apr 25, 2019

Actually I like your approach of using the official cli better. Especially the fact that you can pass --validate whereas the api does not offer such functionality. I will test it out and report back.

@aheissenberger
Copy link
Contributor Author

I found this option when looking into the code of the official webpack plugin:
https://github.com/getsentry/sentry-webpack-plugin

I tried to add it but failed to provide the related information programatically at the step in the Serverless pipeline.

I still think that integrating this better with serverless-webpack-plugin would be the best option.

@captnCC
Copy link

captnCC commented Jul 12, 2019

@aheissenberger I took your code and got it to work with a few modifications.
Well not completely working because the file mapping inside of sentry isn't working. While sentry it self shows me that the artifacts are correctly uploaded and prefixed, it says Source code was not found.

How did you get the new SDK to work?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants