nextjs - ✅(Solved) Fix Next.js 16 beta: `dynamicParams = false` breaks parallel route with top-level dynamic segment [2 pull requests, 7 comments, 3 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#84738Fetched 2026-04-08 02:18:39
View on GitHub
Comments
7
Participants
3
Timeline
24
Reactions
0
Author
Assignees
Timeline (top)
commented ×7labeled ×5subscribed ×3cross-referenced ×2

Root Cause

It seems like the behavior is caused by this:

Fix Action

Fixed

PR fix notes

PR #84279: Fix dynamic catchall parameter interpolation in parallel routes

Description (problem / solution / changelog)

Fixing a bug

  • Tests added with comprehensive e2e test suite for parallel route navigations
  • Error handling improved with clearer error messages for missing dynamic parameters

What?

Fixes incorrect parameter interpolation where catchall parameters in parallel routes included unintended prefix segments.

Why?

In parallel routes with dynamic catchall parameters, the parameter interpolation was incorrectly including prefix segments from the route path. For example, with a route structure like /[teamSlug]/@slot/[...catchAll], a request to /vercel/test/path would incorrectly set catchAll = ["vercel", "test", "path"] instead of the correct catchAll = ["test", "path"].

This bug affected the accuracy of dynamic parameter values in parallel routes, leading to incorrect behavior in applications relying on these parameters for routing logic.

How?

  • Introduced interpolateParallelRouteParams() function that properly handles path depth traversal for complex route structures
  • Refactored parameter interpolation to occur earlier in the render process, ensuring consistency across both postponed and regular rendering scenarios
  • Updated the getDynamicParam() function to use pre-interpolated parameters instead of performing inline path parsing
  • Added comprehensive e2e tests to cover various parallel route navigation scenarios and parameter interpolation edge cases
  • Improved error handling with more descriptive error messages for missing dynamic parameters

The fix ensures that dynamic parameters are correctly extracted based on their position in the route hierarchy, respecting the boundaries defined by parallel route slots.

NAR-335

Changed files

  • packages/next/errors.json (modified, +2/-1)
  • packages/next/src/build/segment-config/app/app-segments.ts (modified, +1/-1)
  • packages/next/src/build/segment-config/app/collect-root-param-keys.ts (modified, +1/-1)
  • packages/next/src/build/webpack/loaders/next-root-params-loader.ts (modified, +1/-1)
  • packages/next/src/server/app-render/app-render.tsx (modified, +26/-15)
  • packages/next/src/server/app-render/create-component-tree.tsx (modified, +1/-1)
  • packages/next/src/server/app-render/postponed-state.test.ts (modified, +5/-5)
  • packages/next/src/server/app-render/postponed-state.ts (modified, +7/-6)
  • packages/next/src/server/app-render/walk-tree-with-flight-router-state.tsx (modified, +1/-1)
  • packages/next/src/shared/lib/router/utils/get-dynamic-param.test.ts (modified, +92/-362)
  • packages/next/src/shared/lib/router/utils/get-dynamic-param.ts (modified, +105/-54)
  • packages/next/src/shared/lib/router/utils/get-segment-param.tsx (renamed, +2/-2)
  • packages/next/src/shared/lib/router/utils/parse-loader-tree.ts (renamed, +2/-2)
  • test/e2e/app-dir/parallel-route-navigations/app/[teamID]/@slot/[...catchAll]/page.tsx (added, +12/-0)
  • test/e2e/app-dir/parallel-route-navigations/app/[teamID]/layout.tsx (added, +21/-0)
  • test/e2e/app-dir/parallel-route-navigations/app/[teamID]/sub/folder/page.tsx (added, +9/-0)
  • test/e2e/app-dir/parallel-route-navigations/app/[teamID]/sub/other-folder/page.tsx (added, +12/-0)
  • test/e2e/app-dir/parallel-route-navigations/app/component.client.tsx (added, +15/-0)
  • test/e2e/app-dir/parallel-route-navigations/app/component.tsx (added, +34/-0)
  • test/e2e/app-dir/parallel-route-navigations/app/layout.css (added, +10/-0)
  • test/e2e/app-dir/parallel-route-navigations/app/layout.tsx (added, +9/-0)
  • test/e2e/app-dir/parallel-route-navigations/next.config.js (added, +6/-0)
  • test/e2e/app-dir/parallel-route-navigations/parallel-route-navigations.test.ts (added, +140/-0)

PR #8218: meta: upgrade to next.js 16

Description (problem / solution / changelog)

This PR is a draft PR for upgrading to Next.js 16.

  • Development Server Works
  • Production Build fails
❯ pnpm build

> @node-core/website@ prebuild /home/cwunder/GitHub/nodejs.org/apps/site
> node --run build:blog-data


> @node-core/website@ build /home/cwunder/GitHub/nodejs.org/apps/site
> node --run build:default -- --turbopack

   ▲ Next.js 16.0.0-beta.0 (Turbopack)
   - Experiments (use with caution):
     ✓ globalNotFound
     · optimizePackageImports
     ✓ parallelServerBuildTraces
     ✓ parallelServerCompiles
     ✓ turbopackFileSystemCacheForDev
     ✓ webpackBuildWorker

   Creating an optimized production build ...
 ✓ Compiled successfully in 5.1s
   Skipping validation of types
 ✓ Collecting page data in 654ms    
Error occurred prerendering page "/404". Read more: https://nextjs.org/docs/messages/prerender-error
Error [PageNotFoundError]: Cannot find module for page: /_document
    at ignore-listed frames {
  code: 'ENOENT'
}
Export encountered an error on /_error: /404, exiting the build.
 ⨯ Next.js build worker exited with code: 1 and signal: null
 ELIFECYCLE  Command failed with exit code 1.

Changed files

  • .prettierignore (modified, +1/-0)
  • apps/site/app/[locale]/error.tsx (modified, +5/-6)
  • apps/site/app/[locale]/not-found.tsx (modified, +1/-5)
  • apps/site/app/global-error.tsx (removed, +0/-34)
  • apps/site/components/withNodeRelease.tsx (modified, +7/-12)
  • apps/site/eslint.config.js (modified, +1/-1)
  • apps/site/next-env.d.ts (modified, +1/-1)
  • apps/site/next.config.mjs (modified, +5/-5)
  • apps/site/open-next.config.ts (modified, +2/-3)
  • apps/site/package.json (modified, +11/-10)
  • apps/site/tsconfig.json (modified, +3/-2)
  • apps/site/turbo.json (modified, +10/-2)
  • package.json (modified, +2/-2)
  • pnpm-lock.yaml (modified, +743/-255)
  • pnpm-workspace.yaml (modified, +2/-1)

Code Example

Operating System:
  Platform: darwin
  Arch: x64
  Version: Darwin Kernel Version 24.6.0: Mon Jul 14 11:28:17 PDT 2025; root:xnu-11417.140.69~1/RELEASE_X86_64
  Available memory (MB): 16384
  Available CPU cores: 12
Binaries:
  Node: 24.4.1
  npm: 11.4.2
  Yarn: 1.22.22
  pnpm: 10.17.1
Relevant Packages:
  next: 16.0.0-canary.0 // Latest available version is detected (16.0.0-canary.0).
  eslint-config-next: 16.0.0-canary.0
  react: 19.1.0
  react-dom: 19.1.0
  typescript: 5.9.3
Next.js Config:
  output: N/A

---

export const dynamicParams = false;
RAW_BUFFERClick to expand / collapse

Link to the code that reproduces this issue

https://github.com/amannn/nextjs-bug-repro-dynamicfalse/commit/ce4aec8339cb73d1ad4af0c5bda95ea70c03ed83

To Reproduce

  1. Run pnpm i && pnpm dev
  2. Visit /en
  3. Click on "Story" at the top

Current vs. Expected behavior

I expect the page to render correctly, but it fails with a 404.

Provide environment information

Operating System:
  Platform: darwin
  Arch: x64
  Version: Darwin Kernel Version 24.6.0: Mon Jul 14 11:28:17 PDT 2025; root:xnu-11417.140.69~1/RELEASE_X86_64
  Available memory (MB): 16384
  Available CPU cores: 12
Binaries:
  Node: 24.4.1
  npm: 11.4.2
  Yarn: 1.22.22
  pnpm: 10.17.1
Relevant Packages:
  next: 16.0.0-canary.0 // Latest available version is detected (16.0.0-canary.0).
  eslint-config-next: 16.0.0-canary.0
  react: 19.1.0
  react-dom: 19.1.0
  typescript: 5.9.3
Next.js Config:
  output: N/A

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

Internationalization (i18n), Linking and Navigating, Not Found, Parallel & Intercepting Routes

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

next dev (local), next build (local)

Additional context

It seems like the behavior is caused by this:

export const dynamicParams = false;

After removing this line, the app works fine.

Note that this works fine in Next.js 15.x.

extent analysis

TL;DR

The issue can be resolved by removing the line export const dynamicParams = false; or finding an alternative configuration that achieves the desired behavior in Next.js 16.0.0-canary.0.

Guidance

  • The dynamicParams = false setting is likely causing the issue, as removing it resolves the problem.
  • Verify that the page renders correctly after removing this line to confirm the fix.
  • If the dynamicParams setting is required, investigate alternative configurations or workarounds that are compatible with Next.js 16.0.0-canary.0.
  • Check the Next.js documentation and release notes for any changes or updates related to dynamic parameters and internationalization (i18n) in version 16.0.0-canary.0.

Example

No code snippet is provided, as the issue is resolved by removing a specific line of code.

Notes

The fix may not be applicable if the dynamicParams setting is required for specific functionality in the application. Further investigation and testing may be necessary to find an alternative solution.

Recommendation

Apply workaround: Remove the line export const dynamicParams = false; to resolve the issue, as it is not compatible with Next.js 16.0.0-canary.0.

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 - ✅(Solved) Fix Next.js 16 beta: `dynamicParams = false` breaks parallel route with top-level dynamic segment [2 pull requests, 7 comments, 3 participants]