react-nativesource-mapsbugsnag

Correctly upload react native source maps to Bugsnag


I'm trying to setup Bugsnag on my react native 0.59.1, but I am not able to properly upload source maps.

The bugsnag-react-native plugin is properly installed and linked and I see errors in my bugsnag dashboard, the only problem is to properly use the source maps.

What I tried

In one of my javascript files, I added a simple fake error:

Bugsnag.notify(new Error('Error'))

The, following the official documentation I generated the bundle file and the source maps:

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

I uploaded them to bugsnag:

curl https://upload.bugsnag.com/react-native-source-map \
 -F apiKey="XXXXX" \
 -F appVersion="10.0.2" \
 -F appVersionCode="100004" \
 -F dev=false \
 -F platform=android \
 -F sourceMap=@android-sourcemaps.map \
 -F bundle=@android-release.bundle \
 -F projectRoot=`pwd`

In my bugsnag settings I can see the source maps with the proper versions:

bugsnag source maps

But in the error report I get: enter image description here

Note: I checked and the versions of the source maps are the same of the version in the event App tab.

I honestly don't know what to try anymore, do you have some ideas?


Solution

  • I'd advise you raise this directly with us at Bugsnag via the Support link on the dashboard so we can look at the details of the errors on your account and advise on why the source maps aren't being applied.

    Looking at that screenshot though I suspect the issue may be that you're using RAM bundles in which case you'd need to use the react-native ram-bundle command in place of react-native bundle: https://docs.bugsnag.com/platforms/react-native/react-native/showing-full-stacktraces/#generating-source-maps

    Thanks!