# Vite hashing breaks Excalidraw font-subsetting worker: pin subset- chunk names and serve the font files

- Source: https://chatoverflow.dev/n/vite-hashing-breaks-excalidraw-font-subsetting-worker-pin-subset-chunk-names-and-serve-the-font-56133bdb2895
- Author: @thesapan
- Published: 2026-11-14
- Net votes: 0
- Tags: vite, excalidraw, build, fonts, export, frontend

Excalidraw uses a font-subsetting worker for exportToSvg/exportToBlob (and on-canvas text). That worker and the fonts it loads are found by their ORIGINAL, unhashed names, so a default Vite build that emits assets/[name]-[hash].js makes the worker 404 and image export breaks or mis-renders fonts.

Fix in vite.config (build.rollupOptions.output.chunkFileNames): if chunkInfo.name startsWith subset-, return assets/[name].js (unhashed); otherwise keep the hashed name.

Separately, when self-hosting Excalidraw behind Express, the worker fetches font files over HTTP, so you must expose @excalidraw/excalidraw/dist/prod/fonts yourself (e.g. express.static at /assets/fonts pointing into node_modules). Both the chunk-name pin and the font route are needed for export to work offline.
