Docs When something doesn't work
Browser errors show minified code
Upload your build's source maps so browser errors in Relia point at your own file, line and function instead of a minified bundle.
A production build squeezes your code into files like index-a8f3.js. Without source maps, a browser error in Relia points there. With source maps, Relia shows the original file, line and function, with the code around it. Your maps are uploaded to Relia and removed from the build output, so your source code is never published.
What you'll see
- In a session's Console tab, the stack points at a minified file. Under it Relia says: Minified code (…). Upload source maps to see your file and line.
- On the project's Setup tab, the row Source maps (readable browser errors) says None uploaded yet. They upload on your next build.
- In your host's build log, the build still succeeds, with one yellow line:
[relia] source maps were not uploaded: ….
Find the cause
npx relia-sdk@latest init already wires the upload when it sets up a web app:
- Vite apps get the
reliaSourcemapsplugin invite.config. - Other bundlers get
&& relia sourcemaps upload <dist or build> --project-id <id> --build-stepadded to thebuildscript. With--build-stepa failed upload never breaks your build, and the maps are still removed. - It writes an upload token,
RELIA_TOKEN, to.env.localand makes sure.gitignorecovers.env.local. This token can only upload source maps for this one project.
The usual cause: your host (Vercel, Netlify, Render, CI) builds without your .env.local, so it has no token. The build log says no Relia token.
Fix it
In your app's folder, open
.env.localand copy the value ofRELIA_TOKEN. Lost it? Write it again:npx relia-sdk@latest tokenIt finds the project id in the folder (or pass
--project-id <id>), asks you to sign in if needed, and writesRELIA_TOKENto.env.local. A new token replaces your previous upload token for that project.In your host's environment variables, add
RELIA_TOKENwith that value.Build and deploy again. The build log now reports the uploaded maps and that they were removed from the output.
Note: Next.js is not wired by
init. Turn onproductionBrowserSourceMapsinnext.config, and run the upload afternext build(see below).
Set it up by hand
Vite, in vite.config.ts:
import { reliaSourcemaps } from "relia-sdk/vite"
export default { plugins: [reliaSourcemaps({ projectId: "YOUR_PROJECT_ID" })] }
The plugin turns on hidden source maps when your config doesn't set build.sourcemap, uploads after the build, then deletes the .map files. Options: projectId, release, keepMaps (keep the .map files in the output; default false), failOnError (fail the build when the upload fails; default false) and disabled. If your config sets build.sourcemap: false, there is nothing to upload: remove it or set it to "hidden".
Any build, after the build step:
npx relia-sdk@latest sourcemaps upload ./dist --project-id YOUR_PROJECT_ID
Uploading needs RELIA_TOKEN (from the environment, or from .env.local / .env in the folder) or the login saved by npx relia-sdk@latest init. Maps are matched by the bundle's file name, so no release setup is needed. All flags are in the CLI reference.
Check the fix worked
- The Setup tab row says Browser errors point at your own files.
- The next browser error in a session's Console tab shows your file and line (for example
src/main.ts:4 in handlePay) with the line highlighted. A toggle still shows the minified stack.
Errors that happened before the upload stay minified; new ones are readable.
Tip: watch Fix JavaScript errors in production with readable stack traces (2 min).
If something's wrong
no project id: pass--project-id <id>or setRELIA_PROJECT_ID.no .map files in ./dist: your build does not write source maps. Turn them on in your bundler, or check the folder name (dist,build…).- 401 or "token expired": run
npx relia-sdk@latest tokenagain and updateRELIA_TOKENon your host.
Next
Last checked against the product: 1 Nov 2026