Warning: htmlLimitedBots + cacheComponents Causes Download Issues in Vercel
#85560
Unanswered
bolechen
asked this question in
App Router
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
htmlLimitedBots+cacheComponentsCauses Download Issues in VercelTL;DR
DO NOT use
htmlLimitedBots: /.*/with Next.js 16'scacheComponents: truein production. It causes routes to trigger file downloads instead of rendering pages in Vercel deployments.The Problem
When both configurations are enabled:
Symptoms:
localhost:3000)signin (1),page (1)instead of rendering HTMLAffected Routes:
Routes that combine:
"use cache"directive in layoutssearchParams: Promise<...>Why This Happens
htmlLimitedBots: /.*/forces all user agents (including browsers) to wait for blocking metadatacacheComponentsand"use cache"directivesContent-Type: text/htmlheaderThe Solution
Remove
htmlLimitedBotsentirely if using Next.js 16:Why this works:
htmlLimitedBotswas a workaround for Next.js 15.3.1 SEO issues (#79313)Alternative Solutions
If you still need bot-specific metadata behavior, target only real bots:
This avoids affecting normal browser users while maintaining bot behavior.
Reproduction
Live Example (before fix):
After removing
htmlLimitedBots: ✅ Page renders correctlyEnvironment Details
Related Issues
Recommendation
For Next.js 16 users:
cacheComponents: true(stable feature, works great!)htmlLimitedBots: /.*/(outdated workaround)For Next.js 15 users:
htmlLimitedBotsif needed for SEOHope this saves you hours of debugging! 🚀
If you encountered this issue, please react with 👍 to help others find this warning.
Beta Was this translation helpful? Give feedback.
All reactions