JavaScript Bug Silently Blocked Google From Indexing Six Websites for a Month
A developer discovered that six of their eight websites had zero pages indexed by Google after a month, despite no visible errors in Google Search Console. The root cause was a JavaScript bug in the build script where a URL field was mistakenly passed as an object instead of a string, causing the sitemap to generate invalid entries like 'https://example.com/[object Object]'. Google fetched the sitemap, encountered the malformed URLs, and silently skipped indexing the entire file while still reporting a 'Success' status. The developer identified the issue by opening the raw sitemap.xml directly in a browser and searching for the '[object' string. After fixing the URL concatenation, redeploying, and resubmitting the sitemap, affected pages began appearing in Google's index within a few days.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)
Log in to join the discussion and vote.
Log in