getsentry / sentry

Developer-first error tracking and performance monitoring
https://sentry.io
Other
38.5k stars 4.11k forks source link

Source Maps for NextJS server side are not consistent #32686

Closed firebotQL closed 2 years ago

firebotQL commented 2 years ago

Environment

SaaS (https://sentry.io/)

Version

No response

Steps to Reproduce

We are uploading source maps for our next project with such scripts:

sentry-cli releases files "$PROJECT_NAME@$RELEASE_VER" upload-sourcemaps src/.next --url-prefix "~/_next"
sentry-cli releases files "$PROJECT_NAME@$RELEASE_VER" upload-sourcemaps .build --url-prefix "~/../../../../.build"

Which is fine for front end ~/_next prefix, but not for backend of the front-end ~/../../../../.build.

So we do rerun it with:

sentry-cli releases files "$PROJECT_NAME@$RELEASE_VER" upload-sourcemaps src/.next --url-prefix "~/_next"
sentry-cli releases files "$PROJECT_NAME@$RELEASE_VER" upload-sourcemaps .build --url-prefix "~/.build"

Expected Result

We expect it to be consistent and always map source maps within the the same errors coming through (server side of nextjs) . As we run above script it works for an hour and after that it stops without any changes on our end! We don't recompile any code and definitely not uploading any new source maps. We cannot explain on what is going on, we suspect it might be some kind caching on your end but we don't know...

This is when it's working: image With the error event JSON: https://sentry.io/organizations/oxbury/issues/3099686927/events/d78971ce26f3477589b1ec6ccacb3167/json/

Actual Result

This is when it's not working: image image With the error event JSON: https://sentry.io/organizations/oxbury/issues/3099273437/events/e103d9c56b8743b1a8fda043ed8021c6/json/

getsentry-release commented 2 years ago

Routing to @getsentry/team-web-frontend for triage. ⏲️

getsentry-release commented 2 years ago

Routing to @getsentry/owners-native for triage. ⏲️

getsentry-release commented 2 years ago

Routing to @getsentry/owners-ingest for triage. ⏲️

jjbayer commented 2 years ago

Hi @firebotQL, it is definitely possible that the source maps from your first upload are cached for an hour. What happens when you only do the first upload with --url-prefix "~/../../../../.build"? Are stack traces then de-minified correctly for longer than one hour?

Have you excluded all possible reasons in https://docs.sentry.io/platforms/javascript/sourcemaps/troubleshooting_js/?

github-actions[bot] commented 2 years ago

This issue has gone three weeks without activity. In another week, I will close it.

But! If you comment or otherwise update it, I will reset the clock, and if you label it Status: Backlog or Status: In Progress, I will leave it alone ... forever!


"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀