Skip to content

Interface 'ErrorEvent' incorrectly extends interface 'Event' #6575

@gdebunne

Description

@gdebunne

Is there an existing issue for this?

How do you use Sentry?

Sentry Saas (sentry.io)

Which package are you using?

@sentry/react

SDK Version

7.27.0

Framework Version

react 18.2.0

Link to Sentry event

No response

Steps to Reproduce

Compiling some React code with a Sentry dependency using tsc with Typescript 4.9.4 results in this error message:

../node_modules/.pnpm/@sentry+types@7.27.0/node_modules/@sentry/types/types/event.d.ts:65:18 - error TS2430: Interface 'ErrorEvent' incorrectly extends interface 'Event'.
  Types of property 'type' are incompatible.
    Type 'undefined' is not assignable to type 'EventType'.

65 export interface ErrorEvent extends Event {
                    ~~~~~~~~~~


Found 1 error in ../node_modules/.pnpm/@sentry+types@7.27.0/node_modules/@sentry/types/types/event.d.ts:65

A possible fix is to replace type?: EventType; by type: EventType | undefined; on line 47 of event.d.ts

Expected Result

No error

Actual Result

tsc compilation error

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions