Skip to content

fix(api): Resolve the root entry's types under NodeNext - #131216

Merged
BYK merged 2 commits into
masterfrom
fix/api-nodenext-declarations
Nov 16, 2026
Merged

BYK merged 2 commits into
masterfrom
fix/api-nodenext-declarations

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Nov 16, 2026

Copy link
Copy Markdown
Contributor

Projects that use "module": "NodeNext" couldn't use @sentry/api's root-entry types. Hey API's generated modules import each other without file extensions, such as ./sdk.gen, and the emitted .d.ts files kept those imports, which NodeNext can't resolve. Without skipLibCheck, the package's declarations fail to typecheck. With it, every generated operation and the client config are typed any. Published 2.4.0 and 2.5.0 have this.

The declaration emit now adds the .ts extension that the rest of the package already uses. The JS bundles don't change.

Part of #131204.

via @BYK.

--

View Session [Sentry]

Hey API's modules import each other without file extensions, and the emitted declarations kept those specifiers. NodeNext resolution cannot follow them, so projects with module NodeNext got errors from the package's declarations, and with skipLibCheck every generated operation was typed any. The declaration emit now adds the .ts extension the rest of the package uses, and the packed-package test typechecks the root entry under NodeNext as well as bundler resolution.

Co-Authored-By: BYK <[email protected]>
@sentry-junior
sentry-junior Bot requested review from a team as code owners November 16, 2026 11:29
@sentry-junior
sentry-junior Bot requested a review from BYK November 16, 2026 11:29
@github-actions github-actions Bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Nov 16, 2026

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 8b215c1. Configure here.

Declaration emit can write inferred types as import("./module").Name,
which NodeNext rejects without an extension, so the transform rewrites
those specifiers as well.
@BYK
BYK merged commit 16a5d07 into master Nov 16, 2026
87 checks passed
@BYK
BYK deleted the fix/api-nodenext-declarations branch November 16, 2026 13:01

This branch was successfully deployed

1 active deployment
Preview — 4a8095a5 Deployed Nov 16, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant