diff --git a/packages/core/src/compiler/htmlBundler.test.ts b/packages/core/src/compiler/htmlBundler.test.ts
index b820d536fa..d76754e262 100644
--- a/packages/core/src/compiler/htmlBundler.test.ts
+++ b/packages/core/src/compiler/htmlBundler.test.ts
@@ -95,6 +95,29 @@ describe("bundleToSingleHtml", () => {
expect(bundled).not.toContain("./bg.svg");
});
+ it("adds the SVG namespace before inlining an external image", async () => {
+ const svg = '';
+ const dir = makeTempProject({
+ "index.html": `
+
+

+
+
+ `,
+ "assets/icon.svg": svg,
+ });
+
+ const bundled = await bundleToSingleHtml(dir);
+ const { document } = parseHTML(bundled);
+ const src = document.getElementById("external-svg")?.getAttribute("src") ?? "";
+ const encodedSvg = src.replace("data:image/svg+xml;base64,", "");
+
+ expect(src).toMatch(/^data:image\/svg\+xml;base64,/);
+ expect(Buffer.from(encodedSvg, "base64").toString("utf8")).toBe(
+ '',
+ );
+ });
+
it("preserves external SVG fragment references used by