fail build if not using Next canary with PPR flag (#58203)

This is to ensure that folks experimenting with PPR are receiving the latest updates as the feature is actively being worked on.
This commit is contained in:
Zack Tanner 2023-11-08 08:14:10 -08:00 committed by GitHub
parent b4ee33e3ec
commit 2071880c8c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 2 deletions

15
errors/ppr-preview.mdx Normal file
View file

@ -0,0 +1,15 @@
---
title: Partial Prerendering Preview in Next.js Canary
---
## Why This Error Occurred
In your `next.config.js` you enabled `experimental.ppr` but you are not using the latest Next.js canary. To ensure you are experimenting with the latest version, we currently require the use of a canary release.
## Possible Ways to Fix It
- Install `next@canary` (e.g. `npm install next@canary`)
## Useful Links
- [Partial Prerendering Preview](/blog/next-14#partial-prerendering-preview)

View file

@ -256,8 +256,8 @@ function assignDefaults(
result.experimental?.ppr &&
!process.env.__NEXT_VERSION!.includes('canary')
) {
Log.warn(
`The experimental.ppr feature is present in your current version but we recommend using the latest canary version for the best experience.`
throw new Error(
`The experimental.ppr preview feature can only be enabled when using the latest canary version of Next.js. See more info here: https://nextjs.org/docs/messages/ppr-preview`
)
}