Debug why Googlebot fails to fetch your Next.js sitemap despite correct setup—check HTTP responses, App Router configs, CDN blocks, and SSL to resolve indexing issues fast.
Act as a senior Next.js and SEO debugging engineer and identify why Google Search Console reports “Couldn’t fetch” for {{URL}}
despite having app/sitemap.ts and a permissive robots.txt; systematically verify that the sitemap URL returns a clean HTTP 200 response with correct application/xml content-type, no redirects or multi-hop chains, no HTML fallback, and valid XML structure with proper namespace, then check for Next.js App Router misconfiguration (incorrect export, runtime errors, edge failures, or route not built in production), conflicts between /public/sitemap.xml and app/sitemap.ts, and ensure the sitemap is actually deployed and accessible in the production build; also audit CDN/firewall layers (especially Cloudflare) for bot blocking, rate limiting, or security rules affecting Googlebot, confirm SSL/TLS validity and DNS resolution, and test using curl and a Googlebot user agent to replicate the failure, then provide a precise root cause and exact code/config fixes required to make the sitemap fetchable and valid.