JavaScript SourceMap is not used

We have followed the instructions in the documentation so we can upload source maps to Sentry without them being available on the web as outlined here: uploading source maps to sentry

As far as I can tell we have configured this correctly yet Sentry is not using the source map.

We have created a release:

The release has a souce map artifact:

…I can only upload 1 image as a new user… view full post here please

I can see the source map name in the public main.js file on our server.


We are initializing Raven with the release id:

…I can only upload 1 image as a new user… see link above please.

NOTE is NOT hosted on our static server, and the location of main.js is hashed, and would live at something like static/da94f5ffc8cff78aca266ed057cc823a53d460a3/js/main.js. It may be possible that Sentry sees the sourceMappingUrl directive and ignores the uploaded artifacts, but I would like someone to confirm this before I go about changing our build process.


The tilde (~) prefix only removes protocol, host, and port. It does not clear the full path leading up to your file.

So if main.js is located here:

You need to name your source map as:


Just to confirm, will this work even if is not actually at that location? As noted the map file is not publicly available on the web, and we will not be putting it out there.

Just to confirm, will this work even if is not actually at that location?


Okay, I will give that a try. Thanks for the quick reply.

This doesn’t seem to solve the issue, maybe I have misunderstood. When you say:

You need to name your source map

Does this mean in the sourceMappingURL directive in main.js? In my latest deploy the file is located at:


and the last line of the file is:

//# sourceMappingURL=~/static/a2b4b132ff909def364b194eebcb4b8ed7e656f8/

Ok so I resolved the issue with some help from Sentry support. There was a bit of a terminology confusion, when referring to “naming your sourcemap”. This is referring to the name of the sourcemap as a Sentry artifact, not how it is named in in the sourceMappingURL directive. So the solution should look like this:

File hosted at:

Directive in file:

Artifact name in sentry:

The artifact name was what took some time to understand. We use the sentry-cli tool, which also needs a bit of explaination. You can use upload-sourcemaps like this to get it named right in the release artifacts:

sentry-cli [.....] upload-sourcemaps --url-prefix "~/static/da94f5ffc8cff78aca266ed057cc823a53d460a3/js/" /dist/

Hope someone finds this useful.


We should probably make the docs clearer on this. I was also wondering if it makes sense to have sentry-cli have an auto discover mode where you point it to the URL of a minified file and it explains you the command to run to upload the sourcemaps correctly.

Sorry, that I didn’t created a new thread but I’m also have the same problem. And can’t figure out the problem.

  1. My js is served from
  2. sourceMappingURL is common-123.js
  3. I uploaded sourcemaps and js to sentry using webpack as ~/static/common-123.js and ~/static/
  4. Release IDs have fine setup and js errors have correct link to release with correct artefact.
  5. But source maps are not working! In Sentry JSON I see: "sourcemap": ""

What is the problem?

Do you get an error on the events? If yes, which one?

No errors. But in event JSON “data” -> “sourcemap” is ""

hi~ i have some questions

if i’m hosting js file in

//# sourceMappingURL=../sourcemap/

do i need to upload js & sourcemap file to or upload sourcemap file is enough?

should i name sourcemap like this?





:smile: try it and solved, should add urlPrefix: ‘~/web/19a37b68/sourcemap’

1 Like

I did this write up in case it helps anyone in the future.