app.a91f.js:1:36
tells you nothing. When you upload the source map your build produced, the
error detail in RUM → Errors shows the original position instead, for
example ../../src/cart/total.ts:16:23, beside the minified one it was resolved
from. The file is shown exactly as your source map’s sources list names it —
often, as here, a path relative to the map.
Resolution happens when you open an error, against whatever map is uploaded at
that moment. You can upload a map after the errors it describes have already
arrived.
Before you start
You need three things from a Browser project. The first two are read from the API with a session token — see Authentication for how to get one. Every call below also names your organization astenantId; without it the API
answers 401 Missing tenantId. Read your organization id from your session, then
find the project:
PROJECT_ID to it.
The install snippet. Paste it into the <head> of every page:
adminApikey field of the project,
returned to members with the Editor role or above:
1. Declare the release in the page
Add this after the install snippet, with your own name and release id:addRelease still reports errors, but none of them can
be matched to an uploaded map.
2. Upload the maps from your build
Run this from your build pipeline after the bundle is built, with the admin key inAIAXONIQ_ADMIN_KEY. It uploads every *.js.map under the directory you
name, and exits non-zero if any upload fails or no map is found:
dist/assets/app.a91f.js is served at
https://cdn.example.com/static/assets/app.a91f.js:
How an upload is matched to an error
An error is resolved against a map only when both of these match.
Only the path of
url is compared. The host, query string and fragment are
ignored, so these all name the same file:
/admin/main.js and /shop/main.js never share a
map. A url ending in .map is refused with 400, as is a file that is not a
version 3 source map.
Uploading again for the same file and release replaces the map, and the
next error you open uses the new one.
Reading the result
Expand an error in RUM → Errors. Under First script frame you see either Symbolicated, with the original position, the minified position and the release whose map was used — or Not symbolicated, with the reason:Only the first frame that is in a script file is resolved, not the whole
stack. An error from a script loaded from another origin must be allowed to
report its details: load that script with
crossorigin="anonymous" and serve
it with an Access-Control-Allow-Origin header, or the browser hides the
error as Script error. with no stack to resolve.