Skip to content

First error cannot be successfully sent #5225

@diriy

Description

@diriy

What React Native libraries do you use?

Expo Router

Are you using sentry.io or on-premise?

sentry.io (SaS)

@sentry/react-native SDK Version

7.2.0

How does your development environment look like?

⬇  Place the `npx react-native@latest info` output here. ⬇
System:
  OS: macOS 15.6.1
  CPU: (10) arm64 Apple M4
  Memory: 143.20 MB / 24.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 23.11.0
    path: ~/.nvm/versions/node/v23.11.0/bin/node
  Yarn:
    version: 1.22.22
    path: /opt/homebrew/bin/yarn
  npm:
    version: 10.9.2
    path: ~/.nvm/versions/node/v23.11.0/bin/npm
  Watchman:
    version: 2025.03.10.00
    path: /opt/homebrew/bin/watchman
Managers:
  CocoaPods:
    version: 1.16.2
    path: /Users/A/.rbenv/shims/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 24.4
      - iOS 18.4
      - macOS 15.4
      - tvOS 18.4
      - visionOS 2.4
      - watchOS 11.4
  Android SDK: Not Found
IDEs:
  Android Studio: 2024.3 AI-243.24978.46.2431.13363775
  Xcode:
    version: 16.3/16E140
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 17.0.15
    path: /Library/Java/JavaVirtualMachines/zulu-17.jdk/Contents/Home/bin/javac
  Ruby:
    version: 3.2.2
    path: /Users/A/.rbenv/shims/ruby
npmPackages:
  "@react-native-community/cli":
    installed: 20.0.2
    wanted: latest
  react:
    installed: 19.0.0
    wanted: 19.1.1
  react-native:
    installed: 0.79.5
    wanted: 0.79.5
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: Not found
  newArchEnabled: Not found
iOS:
  hermesEnabled: true
  newArchEnabled: true

Sentry.init()

import * as Sentry from '@sentry/react-native'

Sentry.init({
  dsn: process.env.EXPO_PUBLIC_SENTRY,
  sendDefaultPii: true,
  enableLogs: true,
  replaysSessionSampleRate: 0.1,
  replaysOnErrorSampleRate: 1,
  integrations: [Sentry.mobileReplayIntegration(), Sentry.feedbackIntegration()],
})

Steps to Reproduce

  1. Paste the following code of the component:
import * as Sentry from '@sentry/react-native'
import { Button, View } from 'react-native'

export default function TestComponent() {

  return (
    <View>
      <Button
        title="Try!"
        onPress={() => {
          Sentry.captureException(new Error('First error'))
        }}
      />
    </View>
  )
}
  1. Run npm start
  2. Navigate to the component
  3. Click "Try"
  4. See the error in the console.

Expected Result

The first error is sent to Sentry

Actual Result

λ Bundled 969ms node_modules/expo-router/node/render.js (1 module)
Web node_modules/expo-router/entry.js ░░░░░░░░░░░░░░░░  0.0% (0/1)
λ  WARN  "shadow*" style props are deprecated. Use "boxShadow". 
  factory (src/routes/(auth)/_layout.tsx:1:1)
Error storing data ReferenceError: window is not defined
    at /node_modules/@react-native-async-storage/async-storage/lib/commonjs/AsyncStorage.js:71:3
    at /node_modules/@react-native-async-storage/async-storage/lib/commonjs/AsyncStorage.js:41:21
    at new Promise (<anonymous>)
    at createPromise (/node_modules/@react-native-async-storage/async-storage/lib/commonjs/AsyncStorage.js:39:7)
    at Object.setItem (/node_modules/@react-native-async-storage/async-storage/lib/commonjs/AsyncStorage.js:71:3)
    at writeStagedState (/node_modules/redux-persist/lib/createPersistoid.js:98:28)
    at Timeout.ignoreNextOnError (/node_modules/redux-persist/lib/createPersistoid.js:87:7)
    at Timeout.sentryWrapped [as _onTimeout] (/node_modules/@sentry/browser/build/npm/esm/helpers.js:95:7)
    at listOnTimeout (node:internal/timers:608:17)
    at processTimers (node:internal/timers:543:7)
Error storing data TypeError: _ExpoSecureStore.default.setValueWithKeyAsync is not a function
    at Object.setItemAsync (/node_modules/expo-secure-store/build/SecureStore.js:105:27)
    at Object.setItem (/src/helpers/securestorage/secureStoreHelper.ts:14:23)
    at writeStagedState (/node_modules/redux-persist/lib/createPersistoid.js:98:28)
    at Timeout.ignoreNextOnError (/node_modules/redux-persist/lib/createPersistoid.js:87:7)
    at Timeout.sentryWrapped [as _onTimeout] (/node_modules/@sentry/browser/build/npm/esm/helpers.js:95:7)
    at listOnTimeout (node:internal/timers:608:17)
Web Bundled 1609ms node_modules/expo-router/entry.js (1 module)

No error appeared in Sentry logs.
The app has no web version and shouldn't have any.
IOs throws this error. Android is not compiling the app at all.

Metadata

Metadata

Assignees

Projects

Status

Waiting for: Community

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions