Repository navigation
Description
What React Native libraries do you use?
React Native without Frameworks
Are you using sentry.io or on-premise?
sentry.io (SaS)
Are you using any other error monitoring solution alongside Sentry?
No
Other Error Monitoring Solution Name
No response
@sentry/react-native SDK Version
8.35.0 (8.33.0 gives the same errors)
How does your development environment look like?
node v26.12.1 win32-x64, @sentry/react-native 8.35.0, @sentry/browser 10.78.0, react-native 0.88.1, @types/react 19.3.0, typescript 7.0.2
Sentry.init()
Sentry.init({ dsn: '' });Steps to Reproduce
Reproducer: https://gist.github.com/YevheniiKotyrlo/95643911c7f0b7c029e9957a2f8c7cad — sh repro.sh installs the packages above from npm and runs tsc on four configs, printing what each reports.
npm install @sentry/react-native@8.35.0 react-native@0.88.1 react@19.3.1 @types/react@19.3.0 typescript@7.0.2 --ignore-scriptstsconfig.jsonwith"strict": true,"skipLibCheck": false,"module": "preserve","moduleResolution": "bundler","customConditions": ["react-native"],"lib": ["ES2024"],"types": []index.ts:import * as Sentry from '@sentry/react-native'; Sentry.init({ dsn: '' });tsc -p tsconfig.json, and the same with"lib": ["ES2024", "DOM"]
baseline.ts imports only react-native, so the run can tell the errors importing the SDK adds from React Native's own three (react/react-native#59647).
There are two causes:
packages/core/src/js/utils/rnlibrariesinterface.tsline 10 ships asexport type { UnsafeObject } from 'react-native/Libraries/Types/CodegenTypes';indist/js/utils/rnlibrariesinterface.d.ts. React Native 0.88'spackage.jsongives./Libraries/*"types": nulloutside thereact-native-legacy-deep-importscondition, so that import does not resolve. React Native's entry exports the type asCodegenTypes.UnsafeObject.index.tsandoptions.tsimport from@sentry/browserand@sentry/react, which brings the declarations of@sentry/browser,@sentry/browser-utils,@sentry/replayand@sentry/feedbackinto the program. They name DOM types (Window,PerformanceEntry,ShadowRoot, …), which a React Native program has only withlib: ["DOM"], and React Native'ssrc/types/globals.d.tscollides withlib.dom.d.tseven without the SDK.
main at ff72471 differs from the 8.35.0 tag only in packages/core/plugin/src/withSentryAndroidGradlePlugin.ts, the samples and yarn.lock.
Expected Result
tsc -p tsconfig.json (lib: ["ES2024"], skipLibCheck: false) reports no error in @sentry/* declarations: the run ends with verdict: @sentry/react-native's declarations add no error to a React Native program with lib ES2024 and skipLibCheck off and exits 0. Sentry.init keeps the same option types.
Actual Result
sh repro.sh exits 1. Importing the SDK adds 30 errors to the program without lib: ["DOM"]:
tsc -p tsconfig.baseline.json (baseline.ts imports react-native only; lib: ["ES2024"]): exit 1, 3 error(s)
tsc -p tsconfig.json (index.ts imports @sentry/react-native; lib: ["ES2024"]): exit 1, 33 error(s)
30 not in the program without @sentry/react-native:
node_modules/@sentry/react-native/dist/js/utils/rnlibrariesinterface.d.ts(2,35): error TS2307: Cannot find module 'react-native/Libraries/Types/CodegenTypes' or its corresponding type declarations.
29 in 13 @sentry/* declaration file(s): PerformanceEntry (5), PerformanceNavigationTiming, PerformanceResourceTiming (8), Performance, Node, DOMHighResTimeStamp (2), Window (5), Worker, IDBObjectStore, console.assert, ShadowRoot (2), History
node_modules/@sentry/browser-utils/build/types/metrics/browserMetrics.d.ts(95,61): error TS2304: Cannot find name 'PerformanceEntry'.
node_modules/@sentry/browser-utils/build/types/metrics/browserMetrics.d.ts(100,64): error TS2304: Cannot find name 'PerformanceNavigationTiming'.
node_modules/@sentry/browser-utils/build/types/metrics/browserMetrics.d.ts(105,62): error TS2304: Cannot find name 'PerformanceResourceTiming'.
... 26 more
Adding lib: ["DOM"] fails in React Native's own globals, with or without the SDK:
tsc -p tsconfig.baseline-dom.json (baseline.ts; lib: ["ES2024", "DOM"]): exit 1, 72 error(s)
duplicate identifiers in react-native/src/types/globals.d.ts: EndingType, BlobPart, BufferSource, FormData, RequestInfo, XMLHttpRequestResponseType, addEventListener, removeEventListener, AbortSignal, AbortController
node_modules/react-native/src/types/globals.d.ts(155,8): error TS2300: Duplicate identifier 'EndingType'.
tsc -p tsconfig.dom.json (index.ts; lib: ["ES2024", "DOM"]): exit 1, 73 error(s)
verdict: importing @sentry/react-native adds 30 error(s) to a React Native program with lib ES2024 and skipLibCheck off: 1 TS2307 on react-native/Libraries/Types/CodegenTypes, 29 DOM name(s) missing in @sentry/* declarations
Metadata
Metadata
Assignees
Labels
Projects
- StatusShow more project fieldsNo status
Activity
linear-code commentedon Nov 15, 2026
RN-856
YevheniiKotyrlo commentedon Nov 15, 2026
The deep import alone is fixed by importing the type from React Native's entry, which exports the same
CodegenTypesnamespace under its strict TypeScript API; this is the declaration change I apply locally to 8.33.0:The source counterpart is
packages/core/src/js/utils/rnlibrariesinterface.tsline 10. The DOM half of this issue needs a change in what the SDK's public declarations re-export, which no single-line patch covers.alwx commentedon Nov 16, 2026
Thanks for reporting. We've seen your request and added it to our triage queue.
We'll review it shortly and follow up if we need more information or once next steps are clearer.
alwx commentedon Nov 18, 2026
Thanks for the detailed report and the reproducer.
We fixed the first part (the
CodegenTypesdeep import) in #7061.We will not fix the second part (the DOM types) for now. The React Native SDK is built on
@sentry/browserand@sentry/react, and their public types use DOM types such asWindowandPerformanceEntry. Our public types re-export those packages, so TypeScript also reads their declarations. To remove this, we would have to stop exposing the browser SDK types in our public API. That is a large change, and it can break apps that use those types today.For now, we recommend
skipLibCheck: true. This is the default in@react-native/typescript-config. We will keep this in mind if we change how the SDK exposes the browser SDK types.