Skip to content

TypeScript Errors due to dependency woes #16196

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

Open
3 tasks done
pfumagalli opened this issue May 5, 2025 · 1 comment
Open
3 tasks done

TypeScript Errors due to dependency woes #16196

pfumagalli opened this issue May 5, 2025 · 1 comment
Assignees
Labels
Bug External Dependency To close this issue, an external dependency needs to be adjusted/fixed Node.js OpenTelemetry

Comments

@pfumagalli
Copy link

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]
@pfumagalli pfumagalli added the Bug label May 5, 2025
@getsantry getsantry bot moved this to Waiting for: Product Owner in GitHub Issues with 👀 3 May 5, 2025
@pfumagalli pfumagalli changed the title TypeScript Errors due to missing dependency TypeScript Errors due to dependency woes May 5, 2025
@lforst
Copy link
Member

lforst commented May 6, 2025

Hi, thanks for raising. Imo the OTEL instrumentation should probably not pull any types packages into the dependencies at all. We'll see if we can upstream the removal of the types packages from the dependencies.

@getsantry getsantry bot removed the status in GitHub Issues with 👀 3 May 6, 2025
@mydea mydea added External Dependency To close this issue, an external dependency needs to be adjusted/fixed OpenTelemetry labels May 7, 2025 — with Linear
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug External Dependency To close this issue, an external dependency needs to be adjusted/fixed Node.js OpenTelemetry
Projects
Status: No status
Development

No branches or pull requests

4 participants