fix(api): disable declaration emit to unblock staging build (TS4023)#2958
Merged
Conversation
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>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
|
🎉 This PR is included in version 3.66.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
The staging Docker build (
bunx nest build) fails with:nest buildemits.d.ts(declaration: true). The better-authmcpplugin's internalMCPOptionstype leaks into the inferred type of the exportedauth, but it isn't exported/nameable, so declaration emit fails. (Regulartsc --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 pathnest buildruns) now compiles with no errors (--showConfigconfirmsdeclaration: false).🤖 Generated with Claude Code
Summary by cubic
Disable declaration emit in the API build to unblock
nest buildin staging (TS4023 from thebetter-authMCP plugin leaking an internal type). The API doesn't ship.d.ts, so we setdeclaration: falseinapps/api/tsconfig.build.jsonand keep type-checking viatsc --noEmitunchanged.Written for commit 7118c6e. Summary will update on new commits.
Review in cubic