Your AI-Generated SVG Won't Render: The Same 8 Defects Every Time A developer documented eight recurring defects that cause AI-generated SVG files to fail rendering, ranging from a missing xmlns attribute and absent or mismatched viewBox values to unescaped ampersands, NaN coordinates, and shapes styled with fill="none" and no stroke. The writeup distinguishes parse-time failures, which produce a blank result with no error, from files that render but appear empty, and recommends checking xmlns, viewBox against the largest coordinates, invalid tokens, and invisible fills before regenerating. The developer also points to a client-side SVG Repair tool that extracts markup from chat output, fixes the XML, and verifies the repaired file paints a non-empty image. You asked a model for an SVG. The code looks right — tags, paths, colors, all plausible. You paste it into a file, open it in a browser, and get... a blank rectangle. No error, no warning, nothing. If this happens to you regularly, it's not bad luck. SVG is XML, and XML is unforgiving in a way HTML never is. A browser reading HTML will patch over a missing quote or an unclosed tag and render what it can. A browser reading SVG does none of that: one syntax slip and the whole document is rejected — usually silently. Language models generate SVG the way they generate everything else: token by token, plausibly. They pattern-match on millions of examples without running an XML validator or a geometry engine. So they fail on exactly the details a validator would have caught — and they fail in the same ways, over and over. Here are the eight defects behind almost every broken AI-generated SVG I've seen. 1. Missing xmlns attribute. The 1 killer. Without xmlns="http://www.w3.org/2000/svg" the browser treats the file as generic XML. It may render inline in an HTML page, then fail as a standalone file or inside an