Legacy Uploading Methods

This page describes how to upload source maps for older React Native SDKs. If you're using the latest version of the SDK, follow these instructions.

Legacy Instructions for Preparing Source Maps for a Release

You need to generate and upload the source maps at build time for every release of your app for the events sent to be correctly unminified. To do so, follow these steps:

1. Configure CLI

Configure the CLI by reviewing the configuration guide for CLI commands.

2. Generate the bundle and source maps

You can use the React Native CLI to generate the JavaScript bundle and source maps for your app:

Copied
react-native bundle \
  --dev false \
  --platform android \
  --entry-file index.android.js \
  --reset-cache \
  --bundle-output index.android.bundle \
  --sourcemap-output index.android.bundle.map

Learn more about the React Native CLI bundle command.

2.1 Pass your entry file

Pass your entry file to --entry-file for Android or iOS, respectively. By default, this file is usually named index.js. It is often named index.android.js for Android or index.ios.js for iOS.

2.2 Output your bundle files and source maps

These files will output your bundle and source maps. By default, these files are named index.android.bundle and index.android.bundle.map for Android and main.jsbundle and main.jsbundle.map for iOS.

3. Upload the bundle and source maps

Copied
node_modules/@sentry/cli/bin/sentry-cli releases \
    files <release> \
    upload-sourcemaps \
    --dist <dist> \
    --strip-prefix /path/to/project/root \
    index.android.bundle index.android.bundle.map
Help improve this content
Our documentation is open source and available on GitHub. Your contributions are welcome, whether fixing a typo (drat!) or suggesting an update ("yeah, this would be better").