next.js: Enabling PPR causes HTTP 500 when scanned by bots
Link to the code that reproduces this issue
https://github.com/mwskwong/http-500-when-visit-by-bot
mainbranch: PPR enabledfeature/without-pprbranch: removed thepprflag
To Reproduce
- Bootstrap a Next.js app with the CLI
- Enable PPR in the config file
Deployments
main: https://http-500-when-visit-by-bot.vercel.appfeature/without-ppr: http-500-when-visit-by-bot-git-feature-without-ppr-mwskwong.vercel.app
Current vs. Expected behavior
Current The app will throw a 500 error when it is scanned by some social media bots, typically when sharing the link of the website on social media. Reproduced on LinkedIn, Twitter, and Facebook (also with their share debuggers respectively).
It seems that it’s a hydration error, but I’m not sure why it shows up on the server log.
Expected It should not throw an error when the site is scanned by a bot.
Verify canary release
- I verified that the issue exists in the latest Next.js canary release
Provide environment information
Operating System:
Platform: win32
Arch: x64
Version: Windows 11 Home
Binaries:
Node: 20.9.0
npm: N/A
Yarn: N/A
pnpm: 8.14.1
Relevant Packages:
next: 14.0.5-canary.56
eslint-config-next: 14.0.5-canary.56
react: 18.2.0
react-dom: 18.2.0
typescript: 5.3.3
Next.js Config:
output: N/A
Which area(s) are affected? (Select all that apply)
App Router
Which stage(s) are affected? (Select all that apply)
Vercel (Deployed), Other (Deployed)
Additional context
No response
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 19 (5 by maintainers)
As a reminder, PPR is still experimental. We are currently triaging and investigating other, higher requested bugs/features right now, but thank you for providing more details on this issue.
Vercel seems to finally be able to show the full log, so here is one example of it.
Oh, adding www.partialprerendering.com as the reproduction.
https://www.linkedin.com/post-inspector/inspect/https:%2F%2Fwww.partialprerendering.com%2F
As a side note: Leerob’s site, which is also using PPR, suffers from the same issue.