Sentry unable to process EAS Updates Source Maps

Hi,

We’re currently facing an issue with EAS Updates and Sentry sourcemaps. Here are some key points on our process so far:

  • Regular EAS Builds work fine, our Xcode step builds and uploads to sentry (command below)

  • The bundle name in the regular builds (before any EAS updates) is main.jsbundle

  • EAS Updates by default do not upload sourcemaps to sentry, they produce them in /dist folder under some proprietary name ios-<somehash>.js and ios-<somehash>.map.

  • We are using Hermes, so by default these source files and map will be Hermes bytecode (only on EAS Update)

  • We have also tried producing the same (non hermes-bytecode) bundle and providing it to EAS Update to try to ensure that the bundles align,

npx react-native bundle --platform ios --dev false --entry-file index.js --reset-cache --bundle-output dist/main.jsbundle --sourcemap-output dist/main.jsbundle.map --minify false
  • When building using Xcode (regular build), the source map is different (readable, not bytecode).
  • The bundle names on Sentry when we do a regular build is: main.jsbundle, however after a hot update, it becomes a random hash app:///91e31419aa7441243a62b6f77620c604.bundle. (This is not the same hash that EAS Update command produced in /dist).
  • When Sentry is not able to find the artifact for this new bundle, it produces a “Absolute Path Mismatch error”, since it doesn’t have the exact 91e31419aa7441243a62b6f77620c604.bundle name in Release Artifacts.
  • We have tried to manually upload that artifact. The error in Sentry goes away, however the errors are still not properly traced back to the original source (shows the line number in the bundle, not the original source)
  • We have made sure that the //# sourceMappingURL= in the bundle is correctly mapped to the corresponding map.
  • We have also made sure we Sentry.init with the correct dist and release values.

EAS CLI:
eas-cli@3.9.1

Workflow:
Bare

Xcode (Regular build) Sentry step:

"export SENTRY_PROPERTIES=sentry.properties\nexport EXTRA_PACKAGER_ARGS=\"--sourcemap-output $DERIVED_FILE_DIR/main.jsbundle.map\"\nif [[ -f \"$PODS_ROOT/../.xcode.env\" ]]; then\n  source \"$PODS_ROOT/../.xcode.env\"\nfi\nif [[ -f \"$PODS_ROOT/../.xcode.env.local\" ]]; then\n  source \"$PODS_ROOT/../.xcode.env.local\"\nfi\n\n# The project root by default is one level up from the ios directory\nexport PROJECT_ROOT=\"$PROJECT_DIR\"/..\n\nif [[ \"$CONFIGURATION\" = *Debug* ]]; then\n  export SKIP_BUNDLING=1\nfi\n../node_modules/@sentry/cli/bin/sentry-cli react-native xcode `\"$NODE_BINARY\" --print \"require('path').dirname(require.resolve('react-native/package.json')) + '/scripts/react-native-xcode.sh'\"`\n\n\n/bin/sh ../node_modules/@sentry/react-native/scripts/collect-modules.sh\n";

Any idea how we can further debug this issue?

Thanks!

Update: We have resolved the issue, it turns out we needed to use “sentry-expo” instead of the vanilla react-native-sentry which causes the bundle names to mismatch on sentry.