Skip to content

Third party frames are not symbolicated #3546

@pax-k

Description

@pax-k

OS:

  • Windows
  • MacOS
  • Linux

Platform:

  • iOS
  • Android

SDK:

  • "@sentry/react-native": "5.16.0"

SDK version: 5.16.0

react-native version: 0.73.2

Are you using Expo?

  • Yes
  • No

Are you using sentry.io or on-premise?

  • sentry.io (SaaS)
  • on-premise

If you are using sentry.io, please post a link to your issue so we can take a look:

[Link to issue]

Configuration:

(@sentry/react-native)

Sentry.init({
  enabled: ENV.APP_VARIANT !== 'development',
  dsn: ENV.SENTRY_DSN,
  debug: false,
  attachStacktrace: true,
  enableAutoSessionTracking: true,
  attachViewHierarchy: true,
  environment: ENV.APP_VARIANT,
  tracesSampleRate: 1.0,
  enableNdkScopeSync: true,
  _experiments: {
    profilesSampleRate: 1.0,
  },
  enableAppHangTracking: true,
  appHangTimeoutInterval: 5,
  enableAutoPerformanceTracing: true,
  enableTracing: true,
  enableCaptureFailedRequests: true,
  enableWatchdogTerminationTracking: true,
  sessionTrackingIntervalMillis: 10000,
  integrations: [new CaptureConsole({ levels: ['warn', 'error'] }), new HttpClient()],
  beforeBreadcrumb: (breadcrumb) => {
    if (
      ENV.APP_VARIANT === 'production' &&
      breadcrumb.category === 'console' &&
      breadcrumb.level === 'debug'
    ) {
      return null;
    }
    return breadcrumb;
  },
});

(app.config.js)

export default {
  expo: {
    name: getVariantConfigs()[APP_VARIANT].name,
    slug: 'xxx',
    owner: 'zzz',
    version: '0.1.7',
    orientation: 'portrait',
    icon: './assets/icon.png',
    userInterfaceStyle: 'light',
    scheme: 'xxx',
    jsEngine: 'hermes',
    sdkVersion: '50.0.0',
    splash: {
      image: './assets/splash.png',
      resizeMode: 'contain',
      backgroundColor: '#ffffff',
    },
    assetBundlePatterns: ['**/*'],
    ios: {
      supportsTablet: true,
      infoPlist: {
        NSFaceIDUsageDescription: 'Authentication with TouchId or FaceID',
      },
      bundleIdentifier: getVariantConfigs()[APP_VARIANT].ios.bundleIdentifier,
      buildNumber: '145',
    },
    android: {
      package: getVariantConfigs()[APP_VARIANT].android.package,
      adaptiveIcon: {
        foregroundImage: './assets/adaptive-icon.png',
        backgroundColor: '#FFFFFF',
      },
      versionCode: 145,
    },
    web: {
      favicon: './assets/favicon.png',
    },
    plugins: [
      'expo-updates',
      'expo-secure-store',
      [
        '@sentry/react-native/expo',
        {
          project: 'xxx',
          organization: 'yyy',
        },
      ],
    ],
    hooks: {},
    ...
  }

(`metro.config.js)

const { getSentryExpoConfig } = require('@sentry/react-native/metro');
const {
  createSentryMetroSerializer,
} = require('@sentry/react-native/dist/js/tools/sentryMetroSerializer');
const { mergeConfig } = require('metro-config');
const customConfig = require('./metro-custom.config.js');

const config = getSentryExpoConfig(__dirname);

const { resolver } = config;

config.resolver = {
  ...resolver,
  sourceExts: [...resolver.sourceExts, 'cjs', 'mjs'],
  serializer: {
    customSerializer: createSentryMetroSerializer(),
  },
};

module.exports = mergeConfig(config, customConfig);

I have the following issue:

  • I expect to see the source code of an error in Sentry (based on uploaded sourcemaps)

Steps to reproduce:
a) Run EAS Build => it should upload sourcemaps automatically. EAS Build XCode logs:

+ BUNDLE_FILE=/Users/expo/Library/Developer/Xcode/DerivedData/PrevFeatKin-aimsbvhikjjxnbexkicuzygwdefv/Build/Intermediates.noindex/ArchiveIntermediates/PrevFeatKin/BuildProductsPath/Release-iphoneos/PrevFeatKin.app/main.jsbundle
+ [[ false != true ]]
+ [[ ! -f /Users/expo/Library/Developer/Xcode/DerivedData/PrevFeatKin-aimsbvhikjjxnbexkicuzygwdefv/Build/Intermediates.noindex/ArchiveIntermediates/PrevFeatKin/BuildProductsPath/Release-iphoneos/PrevFeatKin.app/main.jsbundle ]]
Using Hermes bundle and combined source map.
Processing react-native sourcemaps for Sentry upload.
> Analyzing 2 sources
> Rewriting sources
> Adding source map references
> Bundled 2 files for upload
> Bundle ID: 40de2ff6-40ed-56a4-a641-311a063a1ee5
> Uploaded files to Sentry
> File upload complete (processing pending on server)
> Organization: xxx
> Project: zzz
> Release: None
> Dist: None
> Upload type: artifact bundle

Source Map Upload Report
  Minified Scripts
    ~/main.jsbundle (sourcemap at main.jsbundle.map, debug id 8426621a-1d1d-4ae8-a24f-1fd9763d933c)
  Source Maps
    ~/main.jsbundle.map (debug id 8426621a-1d1d-4ae8-a24f-1fd9763d933c)
+ '[' -z '' ']'
++ /Users/expo/.nvm/versions/node/v18.16.0/bin/node --print 'require('\''path'\'').dirname(require.resolve('\''@sentry/react-native/package.json'\''))'
+ SENTRY_RN_PACKAGE_PATH=/Users/expo/workingdir/build/node_modules/@sentry/react-native
+ '[' -z '' ']'
+ SENTRY_COLLECT_MODULES=/Users/expo/workingdir/build/node_modules/@sentry/react-native/scripts/collect-modules.sh
+ '[' -f /Users/expo/workingdir/build/node_modules/@sentry/react-native/scripts/collect-modules.sh ']'
+ /bin/sh /Users/expo/workingdir/build/node_modules/@sentry/react-native/scripts/collect-modules.sh
+ [[ Release = *Debug* ]]
+ [[ -z /Users/expo/Library/Developer/Xcode/DerivedData/PrevFeatKin-aimsbvhikjjxnbexkicuzygwdefv/Build/Intermediates.noindex/ArchiveIntermediates/PrevFeatKin/BuildProductsPath/Release-iphoneos ]]
+ [[ -z PrevFeatKin.app ]]
+ [[ -z /Users/expo/Library/Developer/Xcode/DerivedData/PrevFeatKin-aimsbvhikjjxnbexkicuzygwdefv/Build/Intermediates.noindex/ArchiveIntermediates/PrevFeatKin/IntermediateBuildFilesPath/PrevFeatKin.build/Release-iphoneos/PrevFeatKin.build/DerivedSources ]]
+ nodePath=node
+ [[ -n /Users/expo/.nvm/versions/node/v18.16.0/bin/node ]]
+ nodePath=/Users/expo/.nvm/versions/node/v18.16.0/bin/node
++ dirname /Users/expo/workingdir/build/node_modules/@sentry/react-native/scripts/collect-modules.sh
+ thisFilePath=/Users/expo/workingdir/build/node_modules/@sentry/react-native/scripts
+ collectModulesScript=/Users/expo/workingdir/build/node_modules/@sentry/react-native/scripts/../dist/js/tools/collectModules.js
+ destination=/Users/expo/Library/Developer/Xcode/DerivedData/PrevFeatKin-aimsbvhikjjxnbexkicuzygwdefv/Build/Intermediates.noindex/ArchiveIntermediates/PrevFeatKin/BuildProductsPath/Release-iphoneos/PrevFeatKin.app
+ modulesOutput=/Users/expo/Library/Developer/Xcode/DerivedData/PrevFeatKin-aimsbvhikjjxnbexkicuzygwdefv/Build/Intermediates.noindex/ArchiveIntermediates/PrevFeatKin/BuildProductsPath/Release-iphoneos/PrevFeatKin.app/modules.json
+ [[ -z '' ]]
+ sourceMap=/Users/expo/Library/Developer/Xcode/DerivedData/PrevFeatKin-aimsbvhikjjxnbexkicuzygwdefv/Build/Intermediates.noindex/ArchiveIntermediates/PrevFeatKin/IntermediateBuildFilesPath/PrevFeatKin.build/Release-iphoneos/PrevFeatKin.build/DerivedSources/main.jsbundle.map
+ [[ -z '' ]]
+ modulesPaths=/Users/expo/workingdir/build/ios/../node_modules
+ type /Users/expo/.nvm/versions/node/v18.16.0/bin/node
+ /Users/expo/.nvm/versions/node/v18.16.0/bin/node /Users/expo/workingdir/build/node_modules/@sentry/react-native/scripts/../dist/js/tools/collectModules.js /Users/expo/Library/Developer/Xcode/DerivedData/PrevFeatKin-aimsbvhikjjxnbexkicuzygwdefv/Build/Intermediates.noindex/ArchiveIntermediates/PrevFeatKin/IntermediateBuildFilesPath/PrevFeatKin.build/Release-iphoneos/PrevFeatKin.build/DerivedSources/main.jsbundle.map /Users/expo/Library/Developer/Xcode/DerivedData/PrevFeatKin-aimsbvhikjjxnbexkicuzygwdefv/Build/Intermediates.noindex/ArchiveIntermediates/PrevFeatKin/BuildProductsPath/Release-iphoneos/PrevFeatKin.app/modules.json /Users/expo/workingdir/build/ios/../node_modules
Sentry Logger [info]: Reading source map from /Users/expo/Library/Developer/Xcode/DerivedData/PrevFeatKin-aimsbvhikjjxnbexkicuzygwdefv/Build/Intermediates.noindex/ArchiveIntermediates/PrevFeatKin/IntermediateBuildFilesPath/PrevFeatKin.build/Release-iphoneos/PrevFeatKin.build/DerivedSources/main.jsbundle.map
Sentry Logger [info]: Saving modules to /Users/expo/Library/Developer/Xcode/DerivedData/PrevFeatKin-aimsbvhikjjxnbexkicuzygwdefv/Build/Intermediates.noindex/ArchiveIntermediates/PrevFeatKin/BuildProductsPath/Release-iphoneos/PrevFeatKin.app/modules.json
Sentry Logger [info]: Resolving modules from paths /Users/expo/workingdir/build/ios/../node_modules
Sentry Logger [info]: Modules collected and saved to: /Users/expo/Library/Developer/Xcode/DerivedData/PrevFeatKin-aimsbvhikjjxnbexkicuzygwdefv/Build/Intermediates.noindex/ArchiveIntermediates/PrevFeatKin/BuildProductsPath/Release-iphoneos/PrevFeatKin.app/modules.json

b) OR manual upload:

npx expo export
npx sentry-expo-upload-sourcemaps dist

logs:

🐕 Fetching SENTRY_PROJECT from expo config...
SENTRY_PROJECT resolved to kin-mobile from expo config.
⬆️ Uploading dist/_expo/static/js/android/index-1d0e26178998181e88bb42e95947390a.hbc bundle and sourcemap...
> Found 1 file
> Analyzing 1 sources
> Analyzing completed in 0.781s
> Rewriting sources
> Rewriting completed in 0s
> Adding source map references
> Bundling completed in 0.001s
> Bundled 1 file for upload
> Bundle ID: 123a1a0a-4f62-50b8-98eb-8a5c852fb8a4
> Optimizing completed in 0.001s
> Uploading completed in 0.236s
> Uploaded files to Sentry
> Processing completed in 0.243s
> File upload complete (processing pending on server)
> Organization: xxx
> Project: zzz
> Release: None
> Dist: None
> Upload type: artifact bundle

Source Map Upload Report
  Minified Scripts
    ~/index-1d0e26178998181e88bb42e95947390a.hbc (no sourcemap ref)
      - warning: could not determine a source map reference (Could not auto-detect referenced sourcemap for ~/index-1d0e26178998181e88bb42e95947390a.hbc)
⬆️ Uploading dist/_expo/static/js/ios/index-6d01582c3b9b7fa2a5803a5431f9fecd.hbc bundle and sourcemap...
> Found 1 file
> Analyzing 1 sources
> Analyzing completed in 0.779s
> Rewriting sources
> Rewriting completed in 0s
> Adding source map references
> Bundling completed in 0.002s
> Bundled 1 file for upload
> Bundle ID: 5cd92359-70a3-5e29-8917-25b3696199a7
> Optimizing completed in 0s
> Uploading completed in 0.208s
> Uploaded files to Sentry
> Processing completed in 0.272s
> File upload complete (processing pending on server)
> Organization: xxx
> Project: zzz
> Release: None
> Dist: None
> Upload type: artifact bundle

Source Map Upload Report
  Minified Scripts
    ~/index-6d01582c3b9b7fa2a5803a5431f9fecd.hbc (no sourcemap ref)
      - warning: could not determine a source map reference (Could not auto-detect referenced sourcemap for ~/index-6d01582c3b9b7fa2a5803a5431f9fecd.hbc)
✅ Uploaded bundles and sourcemaps to Sentry successfully.

Contents of dist/:

❯ tree dist
dist
├── _expo
│   └── static
│       └── js
│           ├── android
│           │   └── index-1d0e26178998181e88bb42e95947390a.hbc
│           └── ios
│               └── index-6d01582c3b9b7fa2a5803a5431f9fecd.hbc
├── assets
│   ├── 026491af08d90496accb275e49e4c63e
│   ├── 02bc1fa7c0313217bde2d65ccbff40c9
│   ├── 0ea69b5077e7c4696db85dbcba75b0e1
│   ├── 35ba0eaec5a4f5ed12ca16fabeae451d
│   ├── 376d6a4c7f622917c39feb23671ef71d
│   ├── 5223c8d9b0d08b82a5670fb5f71faf78
│   ├── 629a55a7e793da068dc580d184cc0e31
│   ├── 6ee4be30a6bb3c31bc333d88da8cdbb5
│   ├── 778ffc9fe8773a878e9c30a6304784de
│   ├── 7d40544b395c5949f4646f5e150fe020
│   ├── 95d6a6037f694266d9b31763e5d6f099
│   ├── a132ecc4ba5c1517ff83c0fb321bc7fc
│   ├── c79c3606a1cf168006ad3979763c7e0c
│   ├── cdd04e13d4ec83ff0cd13ec8dabdc341
│   ├── e4fe68503ab5d004deb31e43636a0a7c
│   └── f5b790e2ac193b3d41015edb3551f9b8
└── metadata.json

Actual result:

I cannot see the source code which triggered an error

Expected result:

I expect to see the source code which triggered an error

Screenshot 2024-01-23 at 15 38 08

Metadata

Metadata

Assignees

No one assigned

    Labels

    ExpoIssues related to Sentry React Native Expo support
    No fields configured for issues without a type.

    Projects

    Status
    Waiting for: Community

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions