Source code not found on JS files

Hi,

we run on-premise Sentry and we’re facing issues with incorrect mapping *.map files to original source files .ts/.js.

Every release i create new version, upload source maps with sentry-cli binary to this version, but if error will occure, we got error “Source code was not found” and Sentry wants to find them on website, instead on release artifacts.

Source maps are working fine, if they’re on the website. When we delete them, Sentry won’t find them. I tried even disable “Enable JavaScript source fetching” on project, but it didn’t helped.

Source maps are working fine even in development, so i think there is not problem in source maps.

We even upload dist JS files (our source is *.ts). Do we need to upload them?

Server version: 9.1.2
Client SDK version: sentry.javascript.browser:6.0.0

I’ll attach images fe. for version 2021.124.3.

Inside file ng-app.js is correct sourcemap URL //# sourceMappingURL=ng-app_353a961baecf34d71635.js.map. This file is on this release as shown from picture.

We create version and upload source maps this way:

sentry-cli releases new -p "userweb-static" "2021.124.3"
sentry-cli releases finalize "2021.124.3"
sentry-cli releases files "2021.124.3" upload-sourcemaps dist/js
sentry-cli releases -p "userweb-static" set-commits --auto "2021.124.3"

Next image (i can upload only 1): https://i.ibb.co/6H3XPtz/1.jpg

Is there issue with our workflow or with Sentry?

Thanks
John

1 Like

Pinging @kamilogorek and @untitaker for help.

Change line 3 to:

sentry-cli releases files "2021.124.3" upload-sourcemaps dist/js --url-prefix "~/js"

This change alone should fix it. Notice that your frames are pointing to /js/ng-app.js but your artifacts are uploaded as ~/ng-app.js (~/ is a protocol globbing matcher here, so it’ll match the initial / part of the URL). They both need to match to resolve correctly.

1 Like

Thank you @kamilogorek .

But unfortunately, it didn’t help.

Can you link an actual event please?

What do you mean “link”? Picture from event was attached and our Sentry is local only.

Ah, right. My bad. I see that you are using environments in the SDK, can you try to specify --dist production in the upload-sourcemaps command?

Tried (environment/distribution is there), but sadly, no change :frowning:

At this point (assuming you triggered an event after artifacts upload), the only thing that can be wrong here is misconfigured on-premise instance, as everything else is setup correctly. cc @BYK

1 Like