Skip to content

TypeScript Errors due to dependency woes #16196

Open
@pfumagalli

Description

@pfumagalli

Is there an existing issue for this?

How do you use Sentry?

Sentry Saas (sentry.io)

Which SDK are you using?

@sentry/node

SDK Version

9.15.0

Framework Version

Node 20.19.1, TypeScript 5.8.3

Link to Sentry event

No response

Reproduction Example/SDK Setup

The @sentry/[email protected] package pulls in @opentelemetry/[email protected], which in turn pulls in @types/[email protected]. When compiling, I get this:

│ /home/runner/work/lib-api-framework/lib-api-framework/node_modules/@types/pg/index.d.ts
│   12:31  Cannot find module 'pg-protocol/dist/messages' or its corresponding type declarations. [TS2307]
│          | import { NoticeMessage } from 'pg-protocol/dist/messages';

The problem arises when building against @sentry/node with module resolution set to bundler, and it's rather annoying as we (for example) don't use any instrumentation.

Reported upstream here.

Steps to Reproduce

Set module resolution in tsconfig.json to bundler and run tsc

Expected Result

Types should compile

Actual Result

Got this error:

Cannot find module 'pg-protocol/dist/messages' or its corresponding type declarations. [TS2307]

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

Status

No status

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions