nextjs - ✅(Solved) Fix using name `segments` among dynamic route params causes cache misses with Cache components [1 pull requests, 3 comments, 4 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#87090Fetched 2026-04-08 02:07:49
View on GitHub
Comments
3
Participants
4
Timeline
12
Reactions
0
Timeline (top)
commented ×3labeled ×2closed ×1cross-referenced ×1

Error Message

next-16-cache-components-vercel-cache-misses/node_modules/.pnpm/next@[email protected]_react@[email protected]/node_modules/next/dist/server/config.js:243 throw new CanaryOnlyError('experimental.dynamicIO'); ^

CanaryOnlyError: The experimental feature "experimental.dynamicIO" can only be enabled when using the latest canary version of Next.js. at assignDefaults (/Users/adamsoderstrom/Documents/adamsoderstrom/www/projects/next-16-cache-components-vercel-cache-misses/node_modules/.pnpm/next@[email protected]_react@[email protected]/node_modules/next/dist/server/config.js:243:19) at loadConfig (/Users/adamsoderstrom/Documents/adamsoderstrom/www/projects/next-16-cache-components-vercel-cache-misses/node_modules/.pnpm/next@[email protected]_react@[email protected]/node_modules/next/dist/server/config.js:843:32) at async Module.nextDev (/Users/adamsoderstrom/Documents/adamsoderstrom/www/projects/next-16-cache-components-vercel-cache-misses/node_modules/.pnpm/next@[email protected]_react@[email protected]/node_modules/next/dist/cli/next-dev.js:190:14)

Node.js v24.9.0  ELIFECYCLE  Command failed with exit code 1.

Fix Action

Fixed

PR fix notes

PR #90111: segment cache: fix segment cache normalizer

Description (problem / solution / changelog)

This fixes an issue where deploying an app that explicitly named a catch-all segments as [...segments] or [[...segments]] would lead to repeated ISR cache misses on that route, even if it was generated at build time.

This is because the normalizer that is responsible for extracting the segment path wasn't escaping the .segments directory value, so the . was treated as a wildcard. That meant when the server attempted to look up the underlying segment data, it wouldn't find it and would have responded with a 204, which signals to the upstream CDN that it is not a cacheable response.

Fixes #87090

Changed files

  • packages/next/src/server/normalizers/request/segment-prefix-rsc.test.ts (modified, +24/-0)
  • packages/next/src/server/normalizers/request/segment-prefix-rsc.ts (modified, +2/-1)

Code Example

Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 23.6.0: Fri Jul  5 17:54:52 PDT 2024; root:xnu-10063.141.1~2/RELEASE_ARM64_T8103
  Available memory (MB): 16384
  Available CPU cores: 8
Binaries:
  Node: 24.9.0
  npm: 11.6.0
  Yarn: 3.2.2
  pnpm: 9.15.9
Relevant Packages:
  next: 16.1.0-canary.18 // Latest available version is detected (16.1.0-canary.18).
  eslint-config-next: N/A
  react: 19.2.2
  react-dom: 19.2.2
  typescript: 5.9.3
Next.js Config:
  output: N/A

---

next-16-cache-components-vercel-cache-misses/node_modules/.pnpm/next@15.0.5_react-dom@19.2.2_react@19.2.2__react@19.2.2/node_modules/next/dist/server/config.js:243
            throw new CanaryOnlyError('experimental.dynamicIO');
                  ^

CanaryOnlyError: The experimental feature "experimental.dynamicIO" can only be enabled when using the latest canary version of Next.js.
    at assignDefaults (/Users/adamsoderstrom/Documents/adamsoderstrom/www/projects/next-16-cache-components-vercel-cache-misses/node_modules/.pnpm/next@15.0.5_react-dom@19.2.2_react@19.2.2__react@19.2.2/node_modules/next/dist/server/config.js:243:19)
    at loadConfig (/Users/adamsoderstrom/Documents/adamsoderstrom/www/projects/next-16-cache-components-vercel-cache-misses/node_modules/.pnpm/next@15.0.5_react-dom@19.2.2_react@19.2.2__react@19.2.2/node_modules/next/dist/server/config.js:843:32)
    at async Module.nextDev (/Users/adamsoderstrom/Documents/adamsoderstrom/www/projects/next-16-cache-components-vercel-cache-misses/node_modules/.pnpm/next@15.0.5_react-dom@19.2.2_react@19.2.2__react@19.2.2/node_modules/next/dist/cli/next-dev.js:190:14)

Node.js v24.9.0
ELIFECYCLECommand failed with exit code 1.
RAW_BUFFERClick to expand / collapse

Link to the code that reproduces this issue

https://github.com/adamsoderstrom/next-16-cache-components-vercel-cache-misses

To Reproduce

  1. Start the application in development (next dev)
  2. Navigate to the homepage (http://localhost:3000)
  3. Identify the random number
  4. Refresh the page
  5. See that the random number is the same as on last request (use cache works as expected)
  6. Deploy the application to Vercel
  7. Navigate to the homepage (https://next-16-cache-components-vercel-cac.vercel.app/)
  8. Refresh the page
  9. See that the random number is a different number on every request (use cache doesn't seem to take effect)
  10. Locally, rename [[...segments]] to [[...uri]] and rename declarations accordingly in generateStaticParams
  11. Navigate to the homepage (http://localhost:3000).
  12. Refresh the page
  13. See that the random number is the same as on last request (use cache works as expected)
  14. Deploy the updated version of the application to Vercel
  15. Navigate to the homepage (https://next-16-cache-components-vercel-cache-misses-c4r8vf7pi.vercel.app/)
  16. Identify the random number
  17. Refresh the page
  18. See that the random number is the same as on last request (use cache works as expected)

Current vs. Expected behavior

Current behavior

Using the name segments amongst dynamic route parameters causes unexpected cache misses

Expected behavior

Using the name segments amongst dynamic route parameters shouldn't result in unexpected cache misses. If the name segments is reserved, build-time errors indicating that the name is not allowed might be an option.

Provide environment information

Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 23.6.0: Fri Jul  5 17:54:52 PDT 2024; root:xnu-10063.141.1~2/RELEASE_ARM64_T8103
  Available memory (MB): 16384
  Available CPU cores: 8
Binaries:
  Node: 24.9.0
  npm: 11.6.0
  Yarn: 3.2.2
  pnpm: 9.15.9
Relevant Packages:
  next: 16.1.0-canary.18 // Latest available version is detected (16.1.0-canary.18).
  eslint-config-next: N/A
  react: 19.2.2
  react-dom: 19.2.2
  typescript: 5.9.3
Next.js Config:
  output: N/A

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

cacheComponents

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

Vercel (Deployed)

Additional context

I tried to do recreate the error in the oldest version that contains the dynamicIO / cacheComponents logic that is allowed by Vercel (v15.0.5), but when trying to build that version of the application, i get the following error unfortunately:

next-16-cache-components-vercel-cache-misses/node_modules/.pnpm/[email protected][email protected][email protected][email protected]/node_modules/next/dist/server/config.js:243
            throw new CanaryOnlyError('experimental.dynamicIO');
                  ^

CanaryOnlyError: The experimental feature "experimental.dynamicIO" can only be enabled when using the latest canary version of Next.js.
    at assignDefaults (/Users/adamsoderstrom/Documents/adamsoderstrom/www/projects/next-16-cache-components-vercel-cache-misses/node_modules/.pnpm/[email protected][email protected][email protected][email protected]/node_modules/next/dist/server/config.js:243:19)
    at loadConfig (/Users/adamsoderstrom/Documents/adamsoderstrom/www/projects/next-16-cache-components-vercel-cache-misses/node_modules/.pnpm/[email protected][email protected][email protected][email protected]/node_modules/next/dist/server/config.js:843:32)
    at async Module.nextDev (/Users/adamsoderstrom/Documents/adamsoderstrom/www/projects/next-16-cache-components-vercel-cache-misses/node_modules/.pnpm/[email protected][email protected][email protected][email protected]/node_modules/next/dist/cli/next-dev.js:190:14)

Node.js v24.9.0
 ELIFECYCLE  Command failed with exit code 1.

extent analysis

TL;DR

Renaming the dynamic route parameter from segments to a different name, such as uri, resolves the cache miss issue on Vercel.

Guidance

  • The issue seems to be related to the use of segments as a dynamic route parameter, which might be a reserved name.
  • Renaming the parameter to a different name, such as uri, resolves the issue, as shown in the steps to reproduce.
  • Verify that the cache is working as expected by refreshing the page and checking that the random number remains the same.
  • If using a different name is not feasible, consider filing an issue with Next.js or Vercel to report the potential reserved name conflict.

Example

No code snippet is provided, as the issue is resolved by renaming the dynamic route parameter, which can be done in the existing codebase.

Notes

The exact reason for the segments name causing cache misses is unclear, but renaming it resolves the issue. It is possible that segments is a reserved name in Next.js or Vercel, but this is not explicitly stated.

Recommendation

Apply the workaround by renaming the dynamic route parameter to a different name, such as uri, to resolve the cache miss issue on Vercel. This is a simple and effective solution that has been verified to work in the provided example.

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 using name `segments` among dynamic route params causes cache misses with Cache components [1 pull requests, 3 comments, 4 participants]