This article guides you through uploading source maps for your front-end scripts in Bugpilot.

Source maps help make error messages, and stack traces more readable. When you upload source maps to Bugpilot, you will benefit from easier-to-read stack traces when front-end or network errors occur right in your Bugpilot reports.

Prerequisites

  1. Grab a Bugpilot CLI executable from here: Download Bugpilot CLI. You can add the CLI to your project or download it every time a build runs.

    curl -o bugpilot-cli <https://cli-downloads.bugpilot.io/bugpilot_linux_amd64>
    
  2. Get a Source Map Upload Secret from your Bugpilot Dashboard, under Integrations > Source Maps.

  3. You will need to update your CI/CD pipeline to execute one additional command when deploying a new version, similar to what you probably already did with Sentry.

Uploading source-maps

Add the following command after you build a frontend build project. This command will need to execute every time a new version of your app is deployed:

./bugpilot -workspaceId <BUGPILOT-WORKSPACE-ID> -auth <BUGPILOT-FILES-UPLOAD-SECRET> upload-sourcemaps

This command uploads all the .js.map files it can find in the current folder and all its subfolders to Bugpilot.

Additional notes and limitations

  1. All source maps are automatically deleted after 60 days.
  2. There is no current limitation on the number and size of the source maps you can upload, but we plan to introduce reasonable limits soon.
  3. Source map files must have unique names (e.g., include a version number or a hash). This is the default behavior if you're using modern frameworks like create-react-app.

Next steps:

  1. Want to make it easy for your users to report bugs? Check out the Bug Reporting widget.