Source Maps

To get unminified stack traces for JavaScript code, source maps must be generated and uploaded. The React Native SDK handles source maps automatically for iOS with Xcode and Android with Gradle.

If you want to manually invoke the react-native packager, you can get source maps by passing –sourcemap-output. Then upload the generated source maps with sentry-cli with the command upload-sourcemaps.

Configure CLI

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

react-native bundle \
  --dev false \
  --platform android \
  --entry-file \
  --bundle-output \

To upload:

node_modules/@sentry/cli/bin/sentry-cli releases \
    files RELEASE_NAME \
    upload-sourcemaps \
    --strip-prefix /path/to/project/root \

The values for RELEASE_NAME and DISTRIBUTION_NAME are as follows:

the bundle ID or package name (reverse DNS notation of your app) followed by a dash and the human-readable version name that is set for your release. For instance, com.example.myapp-1.0.

If you set the release name within your app, the RELEASE_NAME should be the same value. For example:

  // ...
  release: RELEASE_NAME,

This is the version code or build ID depending on your platform. So for instance just set this to whatever is set in your Info.plist or what your Gradle setup generates (For example, 52).

  // ...

Naming Rules

Name of the bundle files must be set differently per platform:

  • for iOS, the file name must be set to main.jsbundle
  • for Android, the file name must be set to


If source maps are still not recognized, check for warnings similar to:

Missing sources warning

The bundle filename needs to match the filename on the event (and shown on the warning) to correctly apply the source maps.

You can edit this page on GitHub.