Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Property 'setTimeout' does not exist on type ... #15471

Open
3 tasks done
lucas-zimerman opened this issue Feb 24, 2025 · 1 comment
Open
3 tasks done

Property 'setTimeout' does not exist on type ... #15471

lucas-zimerman opened this issue Feb 24, 2025 · 1 comment
Labels
Package: react Issues related to the Sentry React SDK Waiting for: Community

Comments

@lucas-zimerman
Copy link
Contributor

Is there an existing issue for this?

How do you use Sentry?

Sentry Saas (sentry.io)

Which SDK are you using?

@sentry/react

SDK Version

9.1.0

Framework Version

No response

Link to Sentry event

No response

Reproduction Example/SDK Setup

The command tsc --project tsconfig.build.json is failing on the V9 project, but not on V8.

Steps to Reproduce

Go to https://github.com/getsentry/sentry-react-native/tree/lz/fix-type-check
enter the folder dev-packages/type-check
run the command yarn type-check

this will pass the build

on file run-type-check.sh
comment the line yarn add @sentry/react@8.0.0
uncomment the line yarn add @sentry/react

And now build will fail.

Expected Result

Build pass

Actual Result

node_modules/@sentry-internal/browser-utils/build/types-ts3.8/getNativeImplementation.d.ts:8:31 - error TS2339: Property 'setTimeout' does not exist on type '{ navigator?: { userAgent?: string; maxTouchPoints?: number; }; console: Console; PerformanceObserver?: any; Sentry?: any; onerror?: { (event: string | object, source?: string, lineno?: number, colno?: number, error?: Error): any; SENTRY_INSTRUMENTED?: true; }; ... 7 more ...; _sentryEsmLoaderHookRegistered?: bo...'.

8 setTimeout: typeof WINDOW.setTimeout;
~~~~~~~~~~

node_modules/@sentry-internal/browser-utils/build/types-ts3.8/getNativeImplementation.d.ts:67:70 - error TS2339: Property 'setTimeout' does not exist on type '{ navigator?: { userAgent?: string; maxTouchPoints?: number; }; console: Console; PerformanceObserver?: any; Sentry?: any; onerror?: { (event: string | object, source?: string, lineno?: number, colno?: number, error?: Error): any; SENTRY_INSTRUMENTED?: true; }; ... 7 more ...; _sentryEsmLoaderHookRegistered?: bo...'.

67 export declare function setTimeout(...rest: Parameters): ReturnType;
~~~~~~~~~~

node_modules/@sentry-internal/browser-utils/build/types-ts3.8/getNativeImplementation.d.ts:67:109 - error TS2339: Property 'setTimeout' does not exist on type '{ navigator?: { userAgent?: string; maxTouchPoints?: number; }; console: Console; PerformanceObserver?: any; Sentry?: any; onerror?: { (event: string | object, source?: string, lineno?: number, colno?: number, error?: Error): any; SENTRY_INSTRUMENTED?: true; }; ... 7 more ...; _sentryEsmLoaderHookRegistered?: bo...'.

67 export declare function setTimeout(...rest: Parameters): ReturnType;
~~~~~~~~~~

node_modules/@sentry-internal/browser-utils/build/types-ts3.8/metrics/utils.d.ts:36:53 - error TS2304: Cannot find name 'Performance'.

36 export declare function getBrowserPerformanceAPI(): Performance | undefined;
~~~~~~~~~~~

node_modules/@sentry-internal/browser-utils/build/types-ts3.8/types.d.ts:27:109 - error TS2344: Type '"document"' does not satisfy the constraint '"fetch"'.

27 } & import("@sentry/core").Carrier & Pick<Window, Exclude<keyof Window, "document">> & Partial<Pick<Window, "document">>;
~~~~~~~~~~

Found 5 errors.

@lforst
Copy link
Member

lforst commented Feb 25, 2025

I'm guessing this is because we are using Browser types and in the react native type check we don't have the DOM lib. I don't know but is it common for RN to have access to those types?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Package: react Issues related to the Sentry React SDK Waiting for: Community
Projects
Status: Waiting for: Community
Development

No branches or pull requests

2 participants