Poor error message when dynamicParams = false blocks child routes
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 142k
- Forks
- 32.5k
- Avg merge
- 2d 14h
- Merged PRs (30d)
- 351
Description
Link to the code that reproduces this issue
https://github.com/tavurth/nextjs-dynamicparams-bugtook
To Reproduce
- Clone the reproduction repository
- Run
npm install(orbun i) - Run
npm run build && npm run start - Navigate to
http://localhost:3000/en/shared/test-123 - Observe 404 error with
NoFallbackErrorin terminal
Current vs. Expected behavior
Current vs. Expected behavior
Current: Route returns 404 with unhelpful error message in console:
Error: Internal: NoFallbackError
at <anonymous> (.next/server/chunks/ssr/_babdf1ac._.js:2:1128)
at n (.next/server/chunks/ssr/_babdf1ac._.js:2:419)
at responseGenerator (.next/server/chunks/ssr/_babdf1ac._.js:2:2770)
Expected: Either the route should work, or a clear error message should be displayed:
Error: Dynamic route segment [shareId] is blocked by parent configuration
→ app/[locale]/layout.tsx has `export const dynamicParams = false`
→ This prevents child routes from accepting dynamic parameters not in generateStaticParams
→ Solution: Set `dynamicParams = true` in parent layout, or add all shareId values to generateStaticParams
Root Cause: The parent layout (app/[locale]/layout.tsx) has export const dynamicParams = false, which inherits to all child routes. This blocks the child route (app/[locale]/shared/[shareId]/page.tsx) from accepting dynamic shareId parameters. While this is correct behavior, the error message provides no indication of the actual problem or how to fix it.
Workaround: Change dynamicParams = false to dynamicParams = true in the parent layout.
Provide environment information
╰─ Will npx --no-install next info
/bin/sh: pnpm: command not found
Operating System:
Platform: darwin
Arch: arm64
Version: Darwin Kernel Version 24.5.0: Tue Apr 22 19:53:27 PDT 2025; root:xnu-11417.121.6~2/RELEASE_ARM64_T6041
Available memory (MB): 36864
Available CPU cores: 14
Binaries:
Node: 24.6.0
npm: 11.5.1
Yarn: 1.22.22
pnpm: N/A
Relevant Packages:
next: 16.1.1 // Latest available version is detected (16.1.1).
eslint-config-next: N/A
react: 19.2.3
react-dom: 19.2.3
typescript: 5.9.3
Next.js Config:
output: N/A
Which area(s) are affected? (Select all that apply)
Dynamic Routes, Error Handling, Pages Router
Which stage(s) are affected? (Select all that apply)
next start (local)
Additional context
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Clone the linked reproduction, run npm install, then npm run build && npm run start and visit /en/shared/test-123. Read app/[locale]/layout.tsx and app/[locale]/shared/[shareId]/page.tsx to confirm how dynamicParams and generateStaticParams interact. Done means the blocked child-route behavior produces a clear diagnostic or the documented route behavior is corrected, with coverage for this reproduction.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, nextjs, react
- Domain
- web-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100