getsentry / sentry-javascript

Official Sentry SDKs for JavaScript
https://sentry.io
MIT License
7.97k stars 1.57k forks source link

Invalid location in sourcemap #2746

Closed gajus closed 3 years ago

gajus commented 4 years ago

Package + Version

Version:

5.19.2

Description

I've created a repository that replicates the bug.

https://github.com/gajus/sentry-test-web-app

All you need to do is pull the repository and run the commands.

It includes description of the expected/ unexpected behaviour.

https://github.com/gajus/sentry-test-web-app#symptoms

gajus commented 4 years ago

@kamilogorek @HazAT is it possible to get a follow up on this?

It is a pretty big blocker for us.

Boeing787 commented 3 years ago

@kamilogorek @HazAT This is still a blocker for us. Is it possible to take a further look? I + @gajus am happy to help diagnose further 👍

mitsuhiko commented 3 years ago

Unfortunately broken source maps are not an issue that the SDK can mitigate. I had a very brief look over the issue and the source map is indeed invalid. I'm not sure which of your plugins is breaking it but I assume the terser plugin might be doing that. Since this is not a bug in the SDK so I can only close the issue here.

The location 1:21 does not exist in the source map.

I did however not manage to actually get the server running as after transpiling it tries to access process still which is in the browser:

Uncaught ReferenceError: process is not defined
    <anonymous> index.js:8
    <anonymous> main.686bec96acddc9184412.js:1
    <anonymous> main.686bec96acddc9184412.js:1

Do you have the emitted raw browser strack trace?

AbhiPrasad commented 3 years ago

Closing for repo clean up. If you are still encountering issues with source maps, please let us know - we can investigate further. Thanks!

krutoo commented 1 year ago

@AbhiPrasad When i see this log during build:

> Found 37 release files
> Analyzing 37 sources
> Analyzing completed in 0.066s
> Rewriting sources
> Rewriting completed in 0.045s
> Adding source map references
> Bundling files for upload... /my-project/dev/desktop/99.dev.js.map
> Bundling completed in 0.154s
> Optimizing completed in 0.003s
> Uploading completed in 3.206s
> Uploaded release files to Sentry
> Processing completed in 0.209s
> File upload complete (processing pending on server)
> Organization: some-org
> Project: some-proj
> Release: dev
> Dist: None

Does this mean that sourcemaps are valid?

I end up seeing "Invalid location in sourcemap" errors in Sentry web interface