Support TypeScript 7: adapt CLI to work without the programmatic Compiler API
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 2.2k
- Forks
- 465
- Avg merge
- 2d 23h
- Merged PRs (30d)
- 46
Description
Is there an existing issue for this?
- I have searched the existing issues
Why this issue exists alongside #3477 / #3478
#3477 reported the crash when using @nestjs/cli with TypeScript 7.0.2, and #3478 addressed it by adding an early detection guard with an actionable error message. That fix is valuable — users now get a clear "install TypeScript 6" message instead of a raw TypeError.
However, #3478 is a diagnostic improvement, not a compatibility fix. The CLI still cannot run nest build, nest start, or nest start --watch with TypeScript 7. This issue tracks the actual work needed to make the CLI functional with TypeScript 7.
Current behavior
With typescript@7.0.2 installed, all compiler-dependent CLI commands fail because the Node module no longer exports the programmatic Compiler API (getParsedCommandLineOfConfigFile, createProgram, createWatchProgram, getPreEmitDiagnostics, etc.). This affects both the default tsc builder and the SWC builder (which uses the programmatic API for type-checking).
The only workaround today is to bypass the CLI entirely for compilation:
{
"build": "tsc",
"dev": "concurrently \"tsc --watch --preserveWatchOutput\" \"node --watch-path=dist dist/src/main.js\""
}
This works, but users lose CLI features like plugin metadata generation, the integrated SWC type-checker, and the unified nest build/nest start interface.
Expected behavior
nest build and nest start should work with TypeScript 7 once the programmatic API stabilizes (expected in TypeScript 7.1), or the CLI should provide an alternative compilation path that does not depend on it.
Context
TypeScript 7.0 was rewritten in Go and only ships the tsc CLI executable. Microsoft has stated the programmatic Compiler API is expected to return in TypeScript 7.1, but there is no confirmed timeline. As TypeScript 7 adoption grows, more users will hit this incompatibility.
Package version
11.0.24
NestJS version
11.1.28
Node.js version
v26.5.0
In which operating systems have you tested?
- macOS
- Windows
- Linux
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the default tsc builder and SWC builder paths that use getParsedCommandLineOfConfigFile, createProgram, createWatchProgram, and getPreEmitDiagnostics. Test against TypeScript 7.0.2 using nest build, nest start, and nest start --watch. Done means these commands work without the programmatic Compiler API while retaining plugin metadata generation and SWC type-checking.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- node.js, typescript
- Domain
- build-system, cli, compilers
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100