Showing full stacktraces

The JavaScript code in your app is minified in a release build and so is not visible in the stacktraces of errors from your users devices. Uploading source maps enables you to see the original method names, file paths, and line numbers in stacktraces.

It is also necessary to upload symbol files for any Turbo Module C or C++ code that is included in your app.

Uploading source maps

To send React Native source map files to BugSnag, simply POST them to https://upload.bugsnag.com/react-native-source-map with the following parameters:

  • apiKey - the BugSnag API key that is used in your app.
  • appVersion (optional) - the appVersion of the application.
  • platform - this should be set to “vega”.
  • sourceMap - the path to the source map file.
  • bundle - the path to the bundle file.
  • overwrite (optional) - overwrite any existing mappings for this platform and version of your app.
  • projectRoot (optional) - a path to remove from the beginning of the filenames in the mapping file.

Example

$ curl --http1.1 https://upload.bugsnag.com/react-native-source-map \
   -F apiKey=YOUR_API_KEY_HERE \
   -F appVersion=1.2.3 \
   -F platform=vega \
   -F sourceMap=@path/to/index.bundle.map \
   -F bundle=@path/to/index.bundle

If you are using On-premise then use the upload endpoint of your server, or if you are on the BugSnag for Enterprise instance then use https://upload.bugsnag.smartbear.com/.

For more information on uploading source maps see the React Native source map upload API reference.

Uploading native symbol files

Symbol files for C or C++ code from Turbo Modules can be found in:

<turbomodule>/build/<arch>/lib/<turbomodule>.so.debug

Debug symbols for C files are not added by default in Vega builds. To enable debug symbols add the following to your module’s CMakeLists.txt file:

set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g")

To send these shared object files containing symbols to BugSnag, POST them to https://upload.bugsnag.com/ndk-symbol with the following parameters:

  • apiKey - the BugSnag API key that is used in your app.
  • soFile - the path to the shared object file.
  • versionName (optional) - the appVersion of the application.
  • overwrite (optional) - denotes whether to overwrite an existing source map for the specified platform and version combination. (default: true)
  • projectRoot (optional) - a path to remove from the beginning of the filenames in the symbol file

Example

$ curl --http1.1 https://upload.bugsnag.com/linux \
   -F apiKey=YOUR_API_KEY_HERE \
   -F versionName=1.2.3 \
   -F soFile=@my_native_module/build/<arch>/lib/my_native_module.so.debug

If you are using On-premise then use the upload endpoint of your server, or if you are on the BugSnag for Enterprise instance then use https://upload.bugsnag.smartbear.com/.

For more information on uploading symbol files see the NDK upload endpoint.