vercel / vercel/next.js

Next.js 16.3 requiring `typescript` >= v7 package incompatible with monorepo setups

Open
#96,589 1 comment 16 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

TypeScript
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/lourd/next-16.3-monorepo-bug

To Reproduce
  1. Clone the repo
  2. Run pnpm install
  3. Run pnpm nx build my-app or cd into apps/my-app and run pnpm next build or pnpm next dev
Current vs. Expected behavior

I have an Nx monorepo that follows a single version policy, and has many Next.js applications. Each of those use the typescript.ignoreBuildErrors next config option, running typechecking as a separate process from the build.

This has been working with TypeScript 7 just fine by using the alias setup that the TypeScript team recommended, aliasing the typescript package in the repo's root package.json to v6 and installing v7 under a different name.

  "@typescript/native": "npm:typescript@^7.0.2",
  "typescript": "npm:@typescript/typescript6@^6.0.2",

With this, any packages importing from typescript in code find v6, and any invocations of tsc utilize v7.

This no longer works in Next.js 16.3. Building now fails with the error: It looks like you're trying to use TypeScript but do not have the required package(s) installed. It tries to automatically install it, fails to do so, then fails to build.

If I switch the typescript version in my root package.json to simply ^7.0.2 that goes away. But I can't do that, because it breaks many other use cases in the monorepo.

What I want is for Next.js to not do anything at all, or at least the option to do nothing at all in regards to verifying my TypeScript setup; just invoke tsc. I get that more basic or beginner setups might benefit from automated help verifying their dependencies, but for a complex setup it causes problems.

Provide environment information
Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 25.5.0: Tue Jun  9 22:28:34 PDT 2026; root:xnu-12377.121.10~1/RELEASE_ARM64_T6041
  Available memory (MB): 36864
  Available CPU cores: 14
Binaries:
  Node: 24.12.0
  npm: 11.6.2
  Yarn: N/A
  pnpm: 11.18.0
Relevant Packages:
  next: 16.3.0 // Latest available version is detected (16.3.0).
  eslint-config-next: N/A
  react: 19.2.4
  react-dom: 19.2.4
  typescript: 6.0.2
Which area(s) are affected? (Select all that apply)

TypeScript

Which stage(s) are affected? (Select all that apply)

next build (local), next dev (local)

Additional context

It's a semi-viable workaround to go to all of the next.js app directories in my company's monorepo and add another line to the package.json to use typescript v7 there, but it's not desirable, and not something I had to do until v16.3. And it creates more work for applications that use the typescript package, the old v6, as a direct dependency in the TypeScript application code.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked next-16.3-monorepo-bug reproduction, then trace the TypeScript dependency check reached by next build and next dev while reviewing the root package.json alias setup. Done means the monorepo can keep typescript mapped to v6 for imports and invoke the separately installed v7 compiler without Next.js attempting or requiring an incompatible package installation.

Written by the indexing model from the issue text.

Assessment

Tech stack
next.js, typescript
Domain
build-system
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.