Errors · Guides
Mark each release
One command in your deploy uploads the browser bundle's source maps and tells Errors the release is live. Issues then show the release that brought them, and a fix that didn't work shows up as a regression.
Which release an error came from
Every error carries the release of the code that ran. The Laravel SDK takes it from the first of:
MYBEAST_ERRORS_RELEASEin.env,APP_RELEASE,- the git commit your app was checked out at, its first 12 characters, read from
.git.
If your deploy ships without .git, a tarball or an image say, set MYBEAST_ERRORS_RELEASE to your build's name. A release is 1 to 64 letters, digits and . _ + -. Browser errors carry the same release: the Laravel SDK puts it in the page's config.
Run it in your deploy
Once the new release serves requests:
php artisan mybeast:errors-releaseRelease 4f2a9c81d0e3: 3 source map(s) and 0 font(s) uploaded.
Live in production; 2 person(s) to be told an issue is fixed.It does two things, in this order:
- Uploads the browser bundle's source maps, every
*.js.mapunderstorage/app/private/sourcemaps(or--sourcemaps=<folder>). - Tells Errors the release is live in this environment. "It's fixed" notices that were waiting for a newer release go out at that moment (Tell the people it hit).
--release= and --environment= name another release or environment than the app's own. --files-only uploads the maps and says nothing about going live: run it before you switch, then the whole command after.
The command needs the URL and the server secret, and exits with 1 when something is refused, so a deploy script can stop on it.
Source maps
A production bundle is minified, and so are its errors' stacks. With its source maps, Errors shows your own file, line and the code around it instead. Build them without publishing them:
// vite.config.js
export default defineConfig({
build: {
sourcemap: 'hidden', // maps are written, but the bundle doesn't point to them
},
});Then move them out of public/ before the release goes live, so nobody can download them:
npm run build
mkdir -p storage/app/private/sourcemaps
find public/build -name '*.js.map' -exec mv {} storage/app/private/sourcemaps/ \;
# … switch to the new release, then:
php artisan mybeast:errors-release- A map is found by the bundle's file name:
app-3fA9xQ1z.jstakesapp-3fA9xQ1z.js.map, uploaded under the release the page sends. - A stack is mapped when the error arrives. Errors that came in before their release's maps were uploaded stay minified: upload with
--files-onlyfirst if that matters to you. - A map may be up to 20 MB, and must be JSON.
Don't leave maps in public/
public/, anyone can read it.What you see
- Releases lists each release in an environment, the newest first: when it went live, its first event, its source maps and the issues first seen in it.
- The inbox narrows to the issues seen in a release, or first seen in it.
- Each issue shows the release it was first seen in and the latest one.
Regressions
When you resolve an issue, Errors takes it as fixed in the next release. If it happens again, the issue opens again as a regression, with a Regression alert. An event from the release it was resolved in, or an older one still running in a browser tab or a queue worker, doesn't count: the fix isn't there yet.