AI & Agent Dev Bug Sandbox logo
AI & Agent Dev Bug Sandbox
Back to Radar

Next.Js 16.3 TypeScript Version Check Breaks Monorepo Aliases

Next.js 16.3 introduced a minimum TypeScript version requirement of >=7.0.0, but its dependency verification uses the `typescript` package name and treats aliased packages (e.g., pnpm alias `typescript` to v6 and `@typescript/native` to v7) as missing or incompatible, causing builds to fail and auto-install attempts to fail.

highConfidence 85%Next.jsPages RouterServer Actionsnext buildAffected V16.3.0

Origin Analysis

Next.js 16.3 added a dependency validation step that checks the installed `typescript` package version against a minimum required version (>=7.0.0). In monorepos using pnpm aliases, the `typescript` package resolves to v6 while v7 is installed under `@typescript/native`. The validation fails because the resolved `typescript` version is below the minimum, triggering an automatic install of `typescript@latest` that conflicts with the alias and fails, causing the build to abort.
1. Clone the repo https://github.com/lourd/next-16.3-monorepo-bug 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` 4. Observe the error: `It looks like you're trying to use TypeScript but do not have the required package(s) installed.` and failed auto-install.

Fixing Code Block

Edge Case Audit

The patch adds a new config option but does not change default behavior. No breaking changes for existing users. To roll back, revert the patch or set `skipTypeScriptCheck: false`. Potential risk: if users enable this option and later have no valid TypeScript installation, Next.js will fail later during `tsc` invocation with a less clear error; ensure documentation clearly states that the option is for advanced setups. Additionally, future Next.js versions may change internal function signatures, so this patch may need to be updated when upgrading.

Ecosystem Topology

Agent Frameworks

LangChain, LlamaIndex, and Pydantic

  1. highProperty graph relation keys collide when entity IDs or labels contain underscores
  2. highCodeActAgent drops assistant tool-call metadata during handoff, leaving an orphan tool response
  3. high[Bug]: HierarchicalNodeParser async methods return the documents unsplit
  4. highLLM.predict_and_call fails with ValidationError for non-function-calling models when react_chat_formatter is omitted
  5. highAnthropic streaming server-tool input_json_delta overwrites completed client tool_use arguments due to stale cur_tool_call state