Sentry-javascript: Need help with source maps routes in React

Created on 6 May 2019  Â·  13Comments  Â·  Source: getsentry/sentry-javascript

Hello.

I have problem, Sentry not see my sourcemaps. What i do wrong? I think i have problem with paths...

Error:
image

Release artifacts: (I upload there are all files from /src)
image

Sentry webpack settings:

new SentryWebpackPlugin({
      include: ['.', './dist'],                // './dist' for upload app.js and app.js.map without dir (red line)
      ignore: ['node_modules', 'webpack.config.js', 'webpack', 'src/mock', 'cypress'],
      release: process.env.TAG,
}),

URLs example:
_Page url_ - http://example.com/item-line
_Script url_ - http://front.example.com/app.js

All 13 comments

Can you provide a direct link to the event please?

@kamilogorek i can give you link, but you can't see event, because server in local network

Ah 😅 can you post JSON of the event somewhere then? (it's under event ID on your first screen).

There are no sourcemaps resolution errors on your screen though, so it should work just fine.

@kamilogorek yes here it is

redacted — @kamilogorek

Everything looks just fine. I tested it locally right now and had no issues, although I have no experience with on-premise setups. You may want to play around with Django's debug mode and see if your server gives some useful debug output during event digestion process.

Thank you for trying to help. I would like to clarify if I need a hack with include: ['./dist']?
Do I understand correctly that when in JSON Stacktrace filename: '/app.js' it try to match with ~/app.js and ~/app.js.map? And ~/dist/app.js didn't works for this path /app.js?

Correct, paths from the stacktrace are 1:1 correlated with releases artifacts.

This is for example fully working source maps mapping:

image

You may also want to try https://sourcemaps.io/ and make sure that your sourcemaps are generated correctly

make sure that your sourcemaps are generated correctly

ok, thank you for suggestion, i just checked it and everything looks good

Can you explain what happen if i have sourcemaps in server too, for instance:
Script url - http://front.example.com/app.js
Sourcemap url - http://front.example.com/app.js.map

Will it go to Sentry Artifacts first or to my server for check maps? And what happening if server return CORS or something else?

Same here. And I also work through https://docs.sentry.io/platforms/javascript/sourcemaps/#troubleshooting but the problem still exist.

We use sentry for almost one year and this problem suddenly come out from yesterday.

Could you explain where to find the sentry log and confirm the reason why it doesn't see my artifacts. Thx

Will it go to Sentry Artifacts first or to my server for check maps? And what happening if server return CORS or something else?

We go to remote server first and then fallback to uploaded artifacts (this can be changed in the projects setting - you can turn off remote fetching).
You can read the source code of frames resolution here (need some python though) - https://github.com/getsentry/sentry/blob/69cdde9185c4e824fd9edaf8b77d93b18f2dc7a7/src/sentry/lang/javascript/processor.py#L542

We use sentry for almost one year and this problem suddenly come out from yesterday.

@lzane did you updated anything? It sounds add that something "just stopped working". If you updated server itself, please ask here - https://github.com/getsentry/sentry/

You can use DJANGO_LOG_LEVEL to enable it - https://docs.djangoproject.com/en/2.1/topics/logging/

@kamilogorek Thanks you for your explanation, it's helped me for understanding how it works, i hope we can fix this problem with sourcemaps in our server, i direct it to our devops who tuning our sentry server. Maybe if we will have more questions we comeback to you)

I think we can close Issue, if @lzane not having another questions)

Anytime! @lzane feel free to reopen it :)

Was this page helpful?
0 / 5 - 0 ratings