nextjs - 💡(How to fix) Fix Parallel routes breaks typed routes [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
vercel/next.js#90055Fetched 2026-04-08 00:20:54
View on GitHub
Comments
1
Participants
2
Timeline
5
Reactions
0
Timeline (top)
labeled ×3commented ×1issue_type_added ×1

Error Message

Likewise, building the project fails with the same error because it runs the TypeScript compiler. .next/dev/types/app/@sidebar/layout.ts:36:13 - error TS2344: Type 'OmitWithTag<{ params: Promise<{}>; children: ReactNode; } & { sidebar: ReactNode; }, keyof LayoutProps, "default">' does not satisfy the constraint '{ [x: string]: never; }'. Found 1 error in .next/dev/types/app/@sidebar/layout.ts:36 This error is unique to the Webpack build chain. On Turbopack I did not observe this error. This error is present on both latest and canary. But on canary but I ran into a additional TypeScript error, which effects both Webpack and Turbopack and is present even without parallel routes: .next/dev/types/validator.ts:5:56 - error TS2307: Cannot find module './routes.js' or its corresponding type declarations.

Root Cause

Likewise, building the project fails with the same error because it runs the TypeScript compiler.

Code Example

.next/dev/types/app/@sidebar/layout.ts:36:13 - error TS2344: Type 'OmitWithTag<{ params: Promise<{}>; children: ReactNode; } & { sidebar: ReactNode; }, keyof LayoutProps, "default">' does not satisfy the constraint '{ [x: string]: never; }'.
  Property 'sidebar' is incompatible with index signature.
    Type 'ReactNode' is not assignable to type 'never'.
      Type 'undefined' is not assignable to type 'never'.

36 checkFields<Diff<LayoutProps, FirstArg<TEntry['default']>, 'default'>>()
               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


Found 1 error in .next/dev/types/app/@sidebar/layout.ts:36

---

Operating System:
  Platform: win32
  Arch: x64
  Version: Windows 11 Pro
  Available memory (MB): 32189
  Available CPU cores: 14
Binaries:
  Node: 25.0.0
  npm: 11.6.2
  Yarn: N/A
  pnpm: N/A
Relevant Packages:
  next: 16.1.6 // Latest available version is detected (16.1.6).
  eslint-config-next: N/A
  react: 19.2.4
  react-dom: 19.2.4
  typescript: 5.9.3
Next.js Config:
  output: N/A

---

.next/dev/types/validator.ts:5:56 - error TS2307: Cannot find module './routes.js' or its corresponding type declarations.

5 import type { AppRoutes, LayoutRoutes, ParamMap } from "./routes.js"
                                                         ~~~~~~~~~~~~~
RAW_BUFFERClick to expand / collapse

Link to the code that reproduces this issue

https://github.com/mordechaim/parallel-typed-routes

To Reproduce

  1. Start the dev server
  2. Load the page (this triggers typed routes generation)
  3. Run the types script

Likewise, building the project fails with the same error because it runs the TypeScript compiler.

Current vs. Expected behavior

Typescript errors with the following:

.next/dev/types/app/@sidebar/layout.ts:36:13 - error TS2344: Type 'OmitWithTag<{ params: Promise<{}>; children: ReactNode; } & { sidebar: ReactNode; }, keyof LayoutProps, "default">' does not satisfy the constraint '{ [x: string]: never; }'.
  Property 'sidebar' is incompatible with index signature.
    Type 'ReactNode' is not assignable to type 'never'.
      Type 'undefined' is not assignable to type 'never'.

36 checkFields<Diff<LayoutProps, FirstArg<TEntry['default']>, 'default'>>()
               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


Found 1 error in .next/dev/types/app/@sidebar/layout.ts:36

Provide environment information

Operating System:
  Platform: win32
  Arch: x64
  Version: Windows 11 Pro
  Available memory (MB): 32189
  Available CPU cores: 14
Binaries:
  Node: 25.0.0
  npm: 11.6.2
  Yarn: N/A
  pnpm: N/A
Relevant Packages:
  next: 16.1.6 // Latest available version is detected (16.1.6).
  eslint-config-next: N/A
  react: 19.2.4
  react-dom: 19.2.4
  typescript: 5.9.3
Next.js Config:
  output: N/A

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

Parallel & Intercepting Routes, TypeScript, Webpack

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

next dev (local), next build (local)

Additional context

Removing /@sidebar/layout.tsx causes this issue to go away.

This error is unique to the Webpack build chain. On Turbopack I did not observe this error.

This error is present on both latest and canary. But on canary but I ran into a additional TypeScript error, which effects both Webpack and Turbopack and is present even without parallel routes:

.next/dev/types/validator.ts:5:56 - error TS2307: Cannot find module './routes.js' or its corresponding type declarations.

5 import type { AppRoutes, LayoutRoutes, ParamMap } from "./routes.js"
                                                         ~~~~~~~~~~~~~

extent analysis

Quick Fix Overview

  1. Relax the “no‑extra‑keys” constraint that checkFields enforces – allow layout components to expose extra props (e.g. sidebar).
  2. Update the utility type OmitWithTag (or the checkFields signature) so it no longer resolves to { [x: string]: never }.
  3. Fix the missing‑module error by either:
    • adding the .js extension to the import or
    • enabling the new “bundler” module‑resolution mode in tsconfig.json.

Below are the concrete code changes and the exact steps to get the project compiling again.


1️⃣ Relax the checkFields constraint

File: src/types/checkFields.ts (or wherever checkFields is declared)

// Old signature (simplified)
export function checkFields<T extends { [K in keyof T

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

nextjs - 💡(How to fix) Fix Parallel routes breaks typed routes [1 comments, 2 participants]