Uploading sourcemaps without js files using cli

Hi, I’m having a trouble trying to make sourcemaps work.
Is it necessary that my minified files have the definition of the “sourceMappingURL”? Sentry does an automatic discovery?
I used sentry-cli and uploaded only sourcemaps, is it necessary to upload js files too?

The release is:
https://sentry.io/skycop-paraguay-sa/skyweb/releases/4.1.5/

The artifacts:
https://sentry.io/skycop-paraguay-sa/skyweb/releases/4.1.5/artifacts/

Also when I uploaded sourcemaps I used “–url-prefix” to match incidences reported paths.

Please note in the screenshot below that artifact paths and js files in incidences are matching ok

Thanks

To upload sourcemaps you need:

  • the minified files
  • the sourcemaps

Ideally you upload with --rewrite then most of the stuff should work automatically. Note that they need to be all uploaded in one batch or the mappings will not be set up correctly. In that mode you do not need to have sourceMappingURL in the minified file as comment.

Hi mitsuhiko, I tried your suggested method but still the sourcemaps aren’t being loaded.

This is my script:

$ ./node_modules/.bin/sentry-cli releases new —finalize ${version}
$ ./node_modules/.bin/sentry-cli releases set-commits —auto ${version},
$ ./node_modules/.bin/sentry-cli releases files ${version} upload-sourcemaps —url-prefix /skyweb/build .tmp/sentry

The output is:

May be --url-prefix is causing the problem now? The --url-prefix value I’m using matches the path that appear in the exception stacktrace and logically is the same that I use on the page.

Thanks !!!

The ULR prefix needs to be set to ~/something/ or https://yourdomain.com/something/ but not just /something/ or it won’t work. Note that if you provide ~ in the shell you need to use single quotes or your home folder expands.