React Native Stack Traces

Learn how to upload debug files to decode exception stack traces for React Native apps

LogRocket displays captured session errors, exceptions, and crashes in the Logs pane of the session replay Developer tab. If your application code is minified or obfuscated, you will need to upload debug files from your app build to see decoded symbol names in the associated stack traces.

The react-native bundle command can be used to generate bundle and sourcemap files for the JavaScript code in your app's Android and iOS builds:

npx react-native bundle \
  --entry-file index.js \
  --dev false \
  --platform android \
  --bundle-output index.android.bundle
  --sourcemap-output index.android.bundle.map
npx react-native bundle \
  --entry-file index.js \
  --dev false \
  --platform ios \
  --bundle-output index.ios.bundle
  --sourcemap-output index.ios.bundle.map

The resulting files can be uploaded via the process outlined for web sourcemaps here (requires logrocket-cli version 0.14.1 or higher). Note that a release will need to be created before the upload command.

For more information on sourcemaps for React Native applications, see official documentation here.