next-learn
next-learn copied to clipboard
Chapter 10 PPR and Canary Dependencies
- I think chapter 10 deserves additional instruction to update dependencies to the latest canary available from nextjs. Because leaving it to as it is will produce error and will unable to start the dev server.
- This method is preferred because the canary change version rappidly.
- The error i found if we use the stable version
D:\nextjs-dashboard>pnpm dev
> @ dev D:\nextjs-dashboard
> next dev --turbo
D:\nextjs-dashboard\node_modules\.pnpm\[email protected][email protected][email protected][email protected]\node_modules\next\dist\server\config.js:241
throw new CanaryOnlyError('experimental.ppr');
^
CanaryOnlyError: The experimental feature "experimental.ppr" can only be enabled when using the latest canary version of Next.js.
at assignDefaults (D:\nextjs-dashboard\node_modules\.pnpm\[email protected][email protected][email protected][email protected]\node_modules\next\dist\server\config.js:241:19)
at loadConfig (D:\nextjs-dashboard\node_modules\.pnpm\[email protected][email protected][email protected][email protected]\node_modules\next\dist\server\config.js:843:32)
at async Module.nextDev (D:\nextjs-dashboard\node_modules\.pnpm\[email protected][email protected][email protected][email protected]\node_modules\next\dist\cli\next-dev.js:189:14)
Node.js v20.18.0
ELIFECYCLE Command failed with exit code 1.
I need to change package.json for next to "canary" which equivalent as of now to "15.0.2-canary.6" then run pnpm i to resolve compatible react and react-dom version
...
"next": "canary"
...
"react": "19.0.0-rc-1631855f-20241023",
"react-dom": "19.0.0-rc-1631855f-20241023",
...
Thanks for the info. I ran pnpm i next@canary to solve the dev server startup issue.
In the Next.js docs, following the recommendation npm install next@canary causes a dependency issue between React 18 and React 19. Need to use pnpm install next@canary instead.
We've now recommended to install canary as part of using PPR - thanks!
@leerob It seems like the change is not reflected on Chapter 10 yet?
I see it here instead. https://nextjs.org/docs/messages/ppr-preview
Came here because I followed the tutorial in Chapter 10 and got the same error. The docs should be updated.
Yup, came with same issue as others. pnpm install next@canary fixed it for me
This doesn't make sense as the canary version installed by pnpm is 15.1.1-canary.23 while the next version in stable form is 15.1.3 which is higher version.
I was facing the same issue and was fixed with pnpm i next@canary. Also i do agree with @geekysaurabh001
Came here because I followed the tutorial in Chapter 10 and got the same error. The docs should be updated.
Same!
Came here because I followed the tutorial in Chapter 10 and got the same error. The docs should be updated.
Same!