Next.js TypeScript plugin diagnostics not reported by CLI / CI type checking with `tsc` or `next` subcommand
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 142k
- Forks
- 32.4k
- Avg merge
- 2d 14h
- Merged PRs (30d)
- 351
Description
Link to the code that reproduces this issue
https://github.com/karlhorky/repro-next-js-typescript-plugin-diagnostics-no-cli
To Reproduce
- Open the reproduction sandbox at https://codesandbox.io/p/devbox/recursing-lamarr-3ypq8k?file=%2Fapp%2Fpage.tsx%3A3%2C18
- Use the Next.js TypeScript language service plugin: cmd/ctrl-shift-P ->
TypeScript: Select TypeScript Version...->Use Workspace Version - Observe the
The Next.js "metadata" export should be type of "Metadata" from "next". ts(71008)warning-level diagnostic inapp/page.tsx - Run
pnpm tscand observe no diagnostics reported 💥 - Run
pnpm next checkandpnpm next tscand observe that these are not valid subcommands 💥
Terminal output:
➜ workspace git:(main) ✗ pnpm tsc
➜ workspace git:(main) ✗ echo $?
0
➜ workspace git:(main) ✗ pnpm next check
Invalid project directory provided, no such directory: /project/workspace/check
➜ workspace git:(main) ✗ pnpm next tsc
Invalid project directory provided, no such directory: /project/workspace/tsc
Current vs. Expected behavior
The next TypeScript plugin reports Next.js-specific diagnostics through the editor TypeScript language service, but there is no command-line check that reports the same diagnostics.
I am aware that the TypeScript team have up until now (August 2026) rejected the feature request that tsc execute TypeScript language-service plugins:
I expected Next.js to provide a framework-aware CLI type check that includes its own plugin diagnostics, similar to the following prior art:
For Next.js this command could be something like next check or next tsc.
Provide environment information
Operating System:
Platform: linux
Arch: x64
Version: microsoft/typescript-go#1 SMP PREEMPT_DYNAMIC Sun Aug 6 20:05:33 UTC 2023
Available memory (MB): 8198
Available CPU cores: 4
Binaries:
Node: 20.12.1
npm: 10.5.0
Yarn: 1.22.19
pnpm: 8.15.6
Relevant Packages:
next: 16.3.1-canary.13 // Latest available version is detected (16.3.1-canary.13).
eslint-config-next: N/A
react: 19.2.8
react-dom: 19.2.8
typescript: 5.9.3
Next.js Config:
output: N/A
Which area(s) are affected? (Select all that apply)
TypeScript
Which stage(s) are affected? (Select all that apply)
next build (local)
Additional context
Next.js's own TypeScript plugin tests already create a TypeScript LanguageService, wrap it with the next plugin, and call getSemanticDiagnostics():
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 with the reproduction and compare pnpm tsc with the editor diagnostic for app/page.tsx. Read test/development/typescript-plugin/test-utils.ts, especially its LanguageService setup and getSemanticDiagnostics() call, then review the existing CLI entry points. Done means a documented framework-aware command reports the same Next.js plugin diagnostics during local and CI type checking.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- nextjs, typescript
- Domain
- cli, testing-qa
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100