From 884b8e415d2b0316c6570c7d6aa837dac830afef Mon Sep 17 00:00:00 2001 From: Chris Lorenzo Date: Tue, 26 May 2026 17:22:23 -0400 Subject: [PATCH] fix(examples): exclude SVG from Vite asset inlining MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Vite inlines small assets as data: URIs by default (4 KB threshold). For SVG this routes the texture through ImageTexture.loadImage → createImageBitmap(blob), which Chromium can't decode for SVG MIME types (crbug 606319) — the texture upload silently produces an empty bitmap. File-URL SVGs take the loadSvg canvas-rasterization path instead, which works. Excluding only SVG from inlining keeps the default behavior for PNG/etc. and ensures every SVG in the examples app exercises the renderer's SVG code path, in dev and in the CI snapshot runner. Co-Authored-By: Claude Opus 4.7 --- examples/vite.config.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/examples/vite.config.ts b/examples/vite.config.ts index 49640ec..06c8977 100644 --- a/examples/vite.config.ts +++ b/examples/vite.config.ts @@ -55,6 +55,13 @@ export default defineConfig(({ command, mode, isSsrBuild }) => { minify: false, sourcemap: true, outDir: path.resolve(__dirname, 'dist'), + // Never inline SVGs as data URIs. The renderer routes file-URL SVGs + // through loadSvg (canvas rasterization), but data-URI SVGs fall + // through to createImageBitmap, which Chromium can't decode for SVG + // blobs — those textures end up empty. Other asset types keep the + // default inline threshold. + assetsInlineLimit: (filePath) => + filePath.endsWith('.svg') ? false : undefined, }, server: { headers: {