Skip to content

fix(api): disable declaration emit to unblock staging build (TS4023)#2958

Merged
tofikwest merged 1 commit into
mainfrom
fix/api-build-ts4023
May 29, 2026
Merged

fix(api): disable declaration emit to unblock staging build (TS4023)#2958
tofikwest merged 1 commit into
mainfrom
fix/api-build-ts4023

Conversation

@tofikwest
Copy link
Copy Markdown
Contributor

@tofikwest tofikwest commented May 29, 2026

Why

The staging Docker build (bunx nest build) fails with:

src/auth/auth.server.ts:272:14 - error TS4023: Exported variable 'auth' has or is using name 'MCPOptions' from external module ".../better-auth/dist/plugins/mcp/index" but cannot be named.

nest build emits .d.ts (declaration: true). The better-auth mcp plugin's internal MCPOptions type leaks into the inferred type of the exported auth, but it isn't exported/nameable, so declaration emit fails. (Regular tsc --noEmit / the PR typecheck don't emit declarations, so they passed — only the Docker build hits it.)

Fix

Disable declaration emit for the API build (tsconfig.build.json). The API is an app, not a library — it never consumes its own .d.ts. Type-checking (tsc --noEmit) is unaffected; this also future-proofs against other plugins leaking internal option types.

Verified

tsc -p tsconfig.build.json (the exact path nest build runs) now compiles with no errors (--showConfig confirms declaration: false).

🤖 Generated with Claude Code


Summary by cubic

Disable declaration emit in the API build to unblock nest build in staging (TS4023 from the better-auth MCP plugin leaking an internal type). The API doesn't ship .d.ts, so we set declaration: false in apps/api/tsconfig.build.json and keep type-checking via tsc --noEmit unchanged.

Written for commit 7118c6e. Summary will update on new commits.

Review in cubic

nest build emits .d.ts (declaration:true), and the better-auth mcp plugin's internal MCPOptions type leaks into the inferred type of the exported 'auth' but isn't exported/nameable, so declaration emit fails with TS4023 and breaks the Docker build. The API is an app, not a library — it never consumes its own .d.ts — so declaration emit is unnecessary. Disabled it in tsconfig.build.json (type-checking via tsc --noEmit is unaffected; this also future-proofs against other plugins leaking internal option types). Verified with tsc -p tsconfig.build.json (the path nest build uses).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown

vercel Bot commented May 29, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
comp-framework-editor Ready Ready Preview, Comment May 29, 2026 12:34am
2 Skipped Deployments
Project Deployment Actions Updated (UTC)
app Skipped Skipped May 29, 2026 12:34am
portal Skipped Skipped May 29, 2026 12:34am

Request Review

@vercel vercel Bot temporarily deployed to Preview – portal May 29, 2026 00:33 Inactive
@vercel vercel Bot temporarily deployed to Preview – app May 29, 2026 00:33 Inactive
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

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

No issues found across 1 file

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Re-trigger cubic

@tofikwest tofikwest merged commit 4ad4419 into main May 29, 2026
11 checks passed
@tofikwest tofikwest deleted the fix/api-build-ts4023 branch May 29, 2026 00:40
@claudfuen
Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 3.66.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants