-
Notifications
You must be signed in to change notification settings - Fork 30.1k
Open
Open
Copy link
Description
Link to the code that reproduces this issue
https://github.com/adamsoderstrom/next-16-cache-components-vercel-cache-misses
To Reproduce
- Start the application in development (
next dev) - Navigate to the homepage (
http://localhost:3000) - Identify the random number
- Refresh the page
- See that the random number is the same as on last request (
use cacheworks as expected) - Deploy the application to Vercel
- Navigate to the homepage (
https://next-16-cache-components-vercel-cac.vercel.app/) - Refresh the page
- See that the random number is a different number on every request (
use cachedoesn't seem to take effect) - Locally, rename
[[...segments]]to[[...uri]]and rename declarations accordingly ingenerateStaticParams - Navigate to the homepage (
http://localhost:3000). - Refresh the page
- See that the random number is the same as on last request (
use cacheworks as expected) - Deploy the updated version of the application to Vercel
- Navigate to the homepage (
https://next-16-cache-components-vercel-cache-misses-c4r8vf7pi.vercel.app/) - Identify the random number
- Refresh the page
- See that the random number is the same as on last request (
use cacheworks 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/AWhich 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.Metadata
Metadata
Assignees
Labels
No labels