next-learn icon indicating copy to clipboard operation
next-learn copied to clipboard

Chapter 10 PPR and Canary Dependencies

Open mdmahendri opened this issue 1 year ago • 3 comments

  • 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",
...

mdmahendri avatar Oct 25 '24 01:10 mdmahendri

Thanks for the info. I ran pnpm i next@canary to solve the dev server startup issue.

moylanm avatar Oct 25 '24 15:10 moylanm

PPR is still experimental and under development

This error is mentioned on Next.js docs

ashvinpanicker avatar Nov 13 '24 23:11 ashvinpanicker

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.

bluefire2121 avatar Nov 26 '24 21:11 bluefire2121

We've now recommended to install canary as part of using PPR - thanks!

leerob avatar Dec 05 '24 21:12 leerob

@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

leochoo avatar Dec 08 '24 07:12 leochoo

Came here because I followed the tutorial in Chapter 10 and got the same error. The docs should be updated.

drod3763 avatar Dec 29 '24 18:12 drod3763

Yup, came with same issue as others. pnpm install next@canary fixed it for me

aidanpatrickkane avatar Jan 01 '25 03:01 aidanpatrickkane

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.

geekysaurabh001 avatar Jan 01 '25 08:01 geekysaurabh001

I was facing the same issue and was fixed with pnpm i next@canary. Also i do agree with @geekysaurabh001

Riaz5687 avatar Jan 04 '25 21:01 Riaz5687

Came here because I followed the tutorial in Chapter 10 and got the same error. The docs should be updated.

Same!

bi1eygr avatar Jan 05 '25 17:01 bi1eygr

Came here because I followed the tutorial in Chapter 10 and got the same error. The docs should be updated.

Same!

daniyal-abbassi avatar Sep 01 '25 16:09 daniyal-abbassi