docs(deps): correct the TypeScript 7 blocker with tested evidence - #70
Merged
Conversation
The typescript 7.x entry claimed TS 7 "breaks the Next.js 16 build
worker". That was inherited from an undated earlier run and is wrong as
of next@16.3.1 + typescript@7.0.2. Verified by attempt:
- npm run build -> passes, and the TypeScript check drops from ~2.8s
to 933ms on the native compiler
- npm run test:run -> passes, 279/279
- npm run lint -> fails before linting a single file
The real blocker is lint, and lint alone:
Error: typescript-eslint does not support TS 7.0.
at eslint-config-next/node_modules/typescript-eslint/dist/index.js:52
That is an explicit runtime guard, not a peer-range mismatch, so an
override or --legacy-peer-deps would not help. Root cause: TypeScript
7.0 ships no compiler API at all, and typescript-eslint needs one —
the same reason Vue, MDX, Astro, Svelte, and Angular tooling cannot
use TS 7 yet. The new API is slated for TS 7.1, and typescript-eslint
is explicitly targeting >= 7.1 (typescript-eslint#10940). Neither
latest (8.67.0) nor canary (8.67.1-alpha.24) has moved off
typescript: >=4.8.4 <6.1.0, and there is no 9.x line.
Also records the documented TS 6/7 side-by-side alias workaround and
why it is not worth taking here: aliasing typescript to
@typescript/typescript6 means anything calling require('typescript')
gets the 6.0 API, including Next.js's own build-time type check, so
the build returns to TS 6 speed and the only gain is a standalone tsc.
Re-check trigger updated from "typescript-eslint widens its peer
range" to the TS 7.1 release plus typescript-eslint#10940. Note ESLint
10 and TypeScript 7 are likely to unblock in the same window, since
both wait on the same toolchain catching up.
Trial was fully reverted: typescript@6.0.3, no invalid peers, build
and lint green.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
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.
Follow-up to #69. Docs only — no dependency or source changes.
Why
The
typescript7.x row in.claude/references/deps-known-issues.mdclaimed TS 7 "breaks the Next.js 16 build worker." That was inherited from an undated earlier audit run and is wrong as ofnext@16.3.1+typescript@7.0.2. A wrong entry in that file is worse than no entry — it is explicitly the state future/audit-depsruns trust instead of re-deriving.Verified by attempt
Installed
typescript@^7.0.2and ran the full suite:npm run buildnpm run test:runnpm run lintSo the blocker is lint, and lint alone. Next.js declares no
typescriptpeer at all, and the build is not merely fine but measurably faster.Root cause
That message comes from an explicit runtime guard, not a peer-range mismatch — an
overridesentry or--legacy-peer-depswould not help.TypeScript 7.0 ships no compiler API at all. It is the native rewrite and the programmatic interface did not come with it; typescript-eslint requires that API, so it hard-refuses. Same reason Vue, MDX, Astro, Svelte, and Angular tooling cannot use TS 7 yet. The new API is slated for TS 7.1, and typescript-eslint is explicitly targeting
>= 7.1— typescript-eslint#10940.Neither
latest(8.67.0) norcanary(8.67.1-alpha.24) has moved offtypescript: >=4.8.4 <6.1.0, and there is no typescript-eslint 9.x line.Also recorded
The documented TS 6/7 side-by-side alias workaround, and why it is not worth taking here: aliasing
typescriptto@typescript/typescript6means anything callingrequire('typescript')gets the 6.0 API — including Next.js's own build-time type check — so the build returns to TS 6 speed and the only gain is a standalonetsc.The re-check trigger changes from the vague "typescript-eslint widens its peer range" to the concrete TS 7.1 release plus that tracking issue. Note that ESLint 10 and TypeScript 7 are likely to unblock in the same window, since both wait on the same toolchain catching up.
Safety
The TS 7 trial was fully reverted before this commit:
typescript@6.0.3, noinvalid:peers, build and lint green, working tree clean. This PR touches one Markdown file.🤖 Generated with Claude Code