Skip to content

@sentry/replay breaks typescript build: Cannot find module '@sentry-internal/rrweb' or its corresponding type declarations. #8327

Closed
@annervisser

Description

@annervisser

Is there an existing issue for this?

How do you use Sentry?

Sentry Saas (sentry.io)

Which SDK are you using?

@sentry/angular-ivy

Note: This option isn't available in the dropdown in the issue template

SDK Version

7.55.0

Framework Version

7.55.0

Link to Sentry event

No response

SDK Setup

No response

Steps to Reproduce

  1. Create a new angular project: ng new --no-interactive sentry-type-error && cd sentry-type-error
  2. Install sentry: npm install @sentry/angular-ivy
  3. Import Sentry in main.ts:
    • Automatically: sed -i "1iimport * as Sentry from '@sentry/angular-ivy';" src/main.ts
    • Or manually add this to main.ts: import * as Sentry from '@sentry/angular-ivy';
  4. Build the application: ng build

Expected Result

The application builds, and sentry is available to initialize

Actual Result

The application doesn't build because of typescript errors:

$ ng build
✔ Browser application bundle generation complete.

Error: node_modules/@sentry/replay/types/index.d.ts:3:27 - error TS2307: Cannot find module '@sentry-internal/rrweb' or its corresponding type declarations.

3 export { EventType } from '@sentry-internal/rrweb';
                            ~~~~~~~~~~~~~~~~~~~~~~~~


Error: node_modules/@sentry/replay/types/index.d.ts:4:26 - error TS2307: Cannot find module '@sentry-internal/rrweb-snapshot' or its corresponding type declarations.

4 export { NodeType } from '@sentry-internal/rrweb-snapshot';
                           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


Error: node_modules/@sentry/replay/types/index.d.ts:5:55 - error TS2307: Cannot find module '@sentry-internal/rrweb' or its corresponding type declarations.

5 export type { eventWithTime, fullSnapshotEvent } from '@sentry-internal/rrweb';
                                                        ~~~~~~~~~~~~~~~~~~~~~~~~


Error: node_modules/@sentry/replay/types/index.d.ts:6:43 - error TS2307: Cannot find module '@sentry-internal/rrweb-snapshot' or its corresponding type declarations.

6 export type { serializedNodeWithId } from '@sentry-internal/rrweb-snapshot';
                                            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


Error: node_modules/@sentry/replay/types/types/replayFrame.d.ts:1:32 - error TS2307: Cannot find module '@sentry-internal/rrweb' or its corresponding type declarations.

1 import type { EventType } from '@sentry-internal/rrweb';
                                 ~~~~~~~~~~~~~~~~~~~~~~~~


Error: node_modules/@sentry/replay/types/types/rrweb.d.ts:1:32 - error TS2307: Cannot find module '@sentry-internal/rrweb' or its corresponding type declarations.

1 import type { EventType } from '@sentry-internal/rrweb';
                                 ~~~~~~~~~~~~~~~~~~~~~~~~

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    Waiting for: Product Owner

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions