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

Incorrect source map reporting in Sentry #678

Closed
reintroducing opened this issue Aug 9, 2016 · 10 comments
Closed

Incorrect source map reporting in Sentry #678

reintroducing opened this issue Aug 9, 2016 · 10 comments

Comments

@reintroducing
Copy link

We have been seeing this a bunch and yesterday was kind of the straw that broke the camel's back for me in terms of just ignoring this. We update our source maps during our deployments by uploading them to Sentry as part of the deployment process and tag everything. We had a build go out yesterday that removed a certain library, nouislider, as we built a new React slider component so we no longer had a use for it. We replaced all instances of the slider in our code base with the new React version and then this morning we saw the following issue pop up in Sentry: https://www.dropbox.com/s/e7isp12g9xh9lpe/Screenshot%202016-08-09%2009.57.10.png?dl=0

As you can see, not only is the error reporting that it came from nouislider but its reporting the method as getValuesFromString which is actually part of our time utils module. I believe the error is actually valid as I've seen it before in our code base but what its mapping back to is completely not as that code doesn't even exist anymore in our codebase.

Any idea what is going on here?

@benvinegar
Copy link
Contributor

benvinegar commented Aug 11, 2016

Are you uploading source map artifacts to Sentry? Or are you hosting source maps on your servers, which are downloaded by Sentry?

If it's the latter, there can sometimes be version mismatches between what's reported and what's downloaded (i.e. if a browser has cached an old JavaScript file/source map, but the version on the server has been updated due to a recent deploy).

Source map interpolation on our end is tested pretty vigorously (our tests are based off of Mozilla's own source-map project), so when there's a line mismatch like this it's almost always the case of either:

a) Sentry getting the wrong source map (from a scenario like the one described above)

OR

b) the source map was generated incorrectly

It sounds like inconsistency is what's affecting you, so my guess is that it's issue a).

@reintroducing
Copy link
Author

Apologies for the late reply, I went on vacation and just getting back to this.

We are uploading the artifacts to Sentry and tagging the releases based on our release versions. The source map URL also stays in our production JS though and the maps get uploaded to the production server as well.

Is it possible that is confusing Sentry?

@benvinegar
Copy link
Contributor

Sentry uses the sourceMappingURL from the JS files it locates, which can either by via artifacts or from your web server.

For complete consistency, you should upload both your source files and source maps if you aren't already.

@reintroducing
Copy link
Author

reintroducing commented Aug 24, 2016

The source files are minified with the sourceMappingURL in them, not original source (that would be a ton of modules to upload). Does that matter? If not, I can add the minified JS to the upload as well in hopes of that helping.

Right now we're only uploading the .map files to Sentry.

@benvinegar
Copy link
Contributor

By source files, I meant "app.min.js" ... like, your minified "source" file / distributable. Sorry for the confusion.

Your original sources (or sources-sources, laugh) are probably embedded inside your source map. Or ought to be. More on this in our docs.

@reintroducing
Copy link
Author

OK, lol, so let me just make sure i'm getting this right:

  1. Upload app.min.js and app.min.js.map to sentry
  2. Upload app.min.js and app.min.js.map to our production server

Is that correct?

@benvinegar
Copy link
Contributor

Is that correct?

Yes.

@reintroducing
Copy link
Author

OK, will give that a shot, thanks @benvinegar.

@benvinegar
Copy link
Contributor

Closing this issue because source maps are strictly handled by Sentry server, not raven-js.

You're welcome to re-open on the Sentry forums if this is still an issue.

@reintroducing
Copy link
Author

Thank you, I meant to close it yesterday but forgot, my apologies.

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

No branches or pull requests

2 participants