next.js: Next.js App Router doesn't work with google cache (http://webcache.googleusercontent.com/)

Link to the code that reproduces this issue or a replay of the bug

https://github.com/vercel-labs/ai-chatbot

To Reproduce

Go to cache page http://webcache.googleusercontent.com/search?q=cache%3Ahttps%3A%2F%2Fchat.vercel.ai&oq=cache%3Ahttps%3A%2F%2Fchat.vercel.ai&gs_lcrp=EgZjaHJvbWUqBggAEEUYOzIGCAAQRRg7MgYIARBFGDwyBggCEEUYOtIBCDQxMDFqMGo0qAIAsAIA&sourceid=chrome&ie=UTF-8 and see a lot of errors in devtools

image

Current vs. Expected behavior

this not ok behavior only in google cache http://webcache.googleusercontent.com/search?q=cache%3Ahttps%3A%2F%2Fchat.vercel.ai&oq=cache%3Ahttps%3A%2F%2Fchat.vercel.ai&gs_lcrp=EgZjaHJvbWUqBggAEEUYOzIGCAAQRRg7MgYIARBFGDwyBggCEEUYOtIBCDQxMDFqMGo0qAIAsAIA&sourceid=chrome&ie=UTF-8 and see a lot of errors in devtools

In real site everything is ok https://chat.vercel.ai/

Verify canary release

  • I verified that the issue exists in the latest Next.js canary release

Provide environment information

"next": "13.4.7-canary.1"

Which area(s) are affected? (Select all that apply)

App Router

Additional context

Also I can show my real project with the same problems

NEXT-1810

About this issue

  • Original URL
  • State: closed
  • Created 10 months ago
  • Reactions: 3
  • Comments: 26 (5 by maintainers)

Most upvoted comments

This issue needs to be fixed asap. Google will hate NextJS projects. How can we fix this issue?

I’ve migrated my Next App from pages directory to app and this started to happen. When I click cache in google i can see my website for 1 sec and then getting these errors.

image

I am facing this issue. Wherein I am getting Client side Application error, when I am trying to open my website with cache:https://bikes.tractorjunction.com

Any help will be appreciated. In the real website, everything is working fine.

Also I can show my real project with the same problems

@pogran could you please add a minimal reproduction of your own that simply reproduces the issue you are having? Please don’t just point to a full/complex codebase. The less code/dependencies the better. This could help the investigation greatly, avoiding any external factors.

Note: Please refrain from tagging the maintainers for a quicker reply, as it might have the opposite effect