#Source maps for React Native Web
3 messages · Page 1 of 1 (latest)
Hi @versed rivet. I'm happy to dig into this for you! I'll check my internal sources for answers to your question! :wave:
Yes, there is an extra step needed to get source maps working for the web version of your Expo app. While source maps for iOS and Android are handled automatically, web source maps require additional configuration.
Based on the information from several issues, here's what you need to do:
- When exporting your web build, make sure to include the
--dump-sourcemapflag:
npx expo export --platform web --dump-sourcemap
- After exporting, upload the source maps using the sentry-expo-upload-sourcemaps tool:
SENTRY_PROJECT=your-project \
SENTRY_ORG=your-org \
npx sentry-expo-upload-sourcemaps dist
If you're using Expo Router with bundle splitting, this might be causing issues with your source maps. You can disable bundle splitting for web by setting asyncRoutes.web to false in your expo-router configuration:
plugins: [
[
'expo-router',
{
asyncRoutes: {
web: false, // SET THIS TO FALSE
default: 'development',
},
},
],
It's also worth noting that source maps are not uploaded for development/debug builds, as mentioned in this issue. Sentry symbolicates the stack trace locally on your computer during development.