You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Deploy a Next.js 15 app with some dynamic routing (app/[slug]/page.tsx for example)
Create the production build
Deploy and run
Googlebot will tag all these pages as Soft 404. Not indexing them.
Current vs. Expected behavior
Dynamic routes served with SSR should be indexed by Googlebot and not be tagged as Soft 404.
The culprit is Next.js’s Image and Link components. On dynamic routes, these components are causing server-side rendering (SSR) failures, leading to soft 404s but only on dynamic routes. The Image component, reliant on Vercel’s image optimization, fails to render images during SSR, possibly due to a runtime change. The Link component’s prefetching is breaking SSR when resolving dynamic hrefs.
Uh oh!
There was an error while loading. Please reload this page.
Link to the code that reproduces this issue
https://github.com/gmoigneu/nextjs15-dynamic-routes-soft-404
To Reproduce
app/[slug]/page.tsx
for example)Current vs. Expected behavior
Dynamic routes served with SSR should be indexed by Googlebot and not be tagged as Soft 404.
The culprit is Next.js’s Image and Link components. On dynamic routes, these components are causing server-side rendering (SSR) failures, leading to soft 404s but only on dynamic routes. The Image component, reliant on Vercel’s image optimization, fails to render images during SSR, possibly due to a runtime change. The Link component’s prefetching is breaking SSR when resolving dynamic hrefs.
See the following blog post for the bug explanation: https://www.academicjobs.com/dyn/failing-dynamic-routes-in-next-js
Making sure the chunks are not indexed by Googlebot in robots.txt fixed the issue:
Provide environment information
Operating System: Platform: darwin Arch: arm64 Version: Darwin Kernel Version 24.5.0: Tue Apr 22 19:54:29 PDT 2025; root:xnu-11417.121.6~2/RELEASE_ARM64_T6030 Available memory (MB): 18432 Available CPU cores: 11 Binaries: Node: 20.17.0 npm: 10.8.2 Yarn: 4.5.1 pnpm: N/A Relevant Packages: next: 15.4.0-canary.56 // Latest available version is detected (15.4.0-canary.56). eslint-config-next: N/A react: 19.1.0 react-dom: 19.1.0 typescript: 5.8.3 Next.js Config: output: N/A
Which area(s) are affected? (Select all that apply)
Dynamic Routes
Which stage(s) are affected? (Select all that apply)
Other (Deployed)
Additional context
No response
The text was updated successfully, but these errors were encountered: