Unable to discover SourceMaps for JS Source Files

I’m having trouble getting Sentry to use Sourcemaps to un-minify / un-transpile my JS source.

I’m running Sentry Server v8.17.0 and RavenJS v3.19.1 and sentry-cli v1.26.1

My sourcemaps cannot be publicly accessible, so I’ve uploaded them using sentry-cli to the host.

While using the application, my js files are accessible via: https://example.com/webpack/<name>-<hash>.chunk.js

These files have the following at the end of the file:
//# sourceMappingURL=<name>.js.map

I’ve tried several different variants for the file prefix when uploading to our self-hosted sentry server that include:

Finally, I’ve tried using both using and omitting the --rewrite flag while using sentry-cli but have every time gotten error messages after the upload has completed:

  Minified Scripts
    ~/webpack/<name>-<hash>.chunk.js (sourcemap at <name>.js.map)
      - warning: could not determine a source map reference (Could not auto-detect referenced sourcemap for ~/webpack/<name>-<hash>.chunk.js.)

Similarly, when I list the files the Source Map column is empty in the resulting table.

I’ve seen several posts like this one, but many of them mention errors that are shown in the sentry webUI. I’m not seeing any errors. I’m not seeing any reference to sourcemap in the event.JSON payload reported (nor in the request from the browser).

A particular frame of the stack trace (as reported in the event.json) looks something like:


Not sure if that has anything to do with it, but it seems as though the Sentry Server code might be looking for something like that in the json payload.

1 Like