A single Search Console alert exposed silent OG image failures across 11 locales
A developer discovered that all 11 locale-specific OpenGraph image routes on their Next.js site had been returning 502 errors, revealed only when Google Search Console flagged a single URL. The root cause was a JSX rendering issue in the OpenGraph image file, where a mixed expression and text node inside a div without an explicit display property caused Satori, Next.js's OG image renderer, to throw an error. Because the response had already started streaming when the error occurred, Nginx logged it as a premature upstream connection close and returned a 502 to clients. No conventional checks — browser testing, build validation, automated tests, or deploy scripts — were capable of catching the failure, since the route is never directly requested by users or imported by any page. The fix was a one-line change converting the mixed JSX children into a single template literal text node, and the developer noted that manually curling the route after any change remains the only reliable way to verify it works.
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