Reputation: 6987
I'm attempting to set up private source maps using Airbrake following the documentation at airbrake.io/docs/features/private-sourcemaps.
From https://airbrake.io/docs/features/private-sourcemaps/#pattern-matching-option:
airbrake sourcemaps create --project-id PROJECT_ID \
--from-file 'app.min.js.map'
--name 'unique-name'
--pattern '%app.min.js'
From this example, it seems the name
parameter has to be a unique name. But when I scroll a little further down the page I see:
For your private source map upload to function correctly it’s important you check that:
- The
name
for the file https://example.com/app.min.js.map should be fully qualified.
Oh, so the name isn't just any random unique name, it has to be a FQN? If I'm uploading the source maps to Airbrake how do I know the URL to put here? The source maps won't be publicly available on my domain so if I put that URL there it will 404.
Looking at the API docs it seems name
refers to yet another thing:
name
| The location of your minified version ofapp.js
that should be publicly available
What should the name be then? Does name
actually refer to different concepts if you're using the CLI vs the HTTP API?
I tried specifying name as both the path to the JS file (e.g. /assets/js/some-hash.js
) as well as where the source map file should be if it were public (in both cases these values were unique).
I didn't get any errors when uploading via the API, but when I ran airbrake sourcemaps list --project-id MY-PROJECT-ID
in the CLI I didn't see anything. That command only showed the source maps if I uploaded them with the CLI manually. But even in that case Airbrake didn't seem to find the source maps. Airbrake would show the following for sourceMapErrors
under Occurrences > Context:
"https://exmaple.com/assets/js/some-hash.js": "http.Get url=\"https://exmaple.com/assets/js/some-hash.map\": got 404 Not Found, expected 200 OK"
Why is Airbrake attempting to look for it at that URL when it's not going to be publicly available? And why is it looking for a .map
and not a .js.map
file? Even when my source maps are made publicly available it doesn't work.
How am I suppose to get private source maps to work for Airbrake? I'm using the latest version of Airbrake for the browser: @airbrake/[email protected]
.
Upvotes: 4
Views: 252