From 6bdf4bb4a072c151222ab46486d0f1b010faefd4 Mon Sep 17 00:00:00 2001 From: MHSanaei Date: Sat, 9 May 2026 16:44:15 +0200 Subject: [PATCH] fix(embed): include underscore-prefixed Vite chunks in dist FS MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit go:embed silently excludes files whose names start with `_` or `.`, so the `_plugin-vue_export-helper-.js` chunk that Vite/rolldown emits for @vitejs/plugin-vue was missing from the production binary. First import at runtime hit a 404 and the SPA failed to mount — blank page on every page load, no error in the server logs because the asset 404 was just a static-handler miss. Switched the directive to `//go:embed all:dist` which keeps the same root layout but disables the underscore/dot exclusion rule. Dev mode was unaffected (it serves dist/assets/ from disk, not the embedded FS). Co-Authored-By: Claude Opus 4.7 --- web/web.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/web/web.go b/web/web.go index 12790b0b..8c7577f1 100644 --- a/web/web.go +++ b/web/web.go @@ -41,7 +41,13 @@ var i18nFS embed.FS // HTML route is served straight out of this FS — the legacy Go // templates and `web/assets/` tree are gone post-Phase 8. // -//go:embed dist/* +// `all:` is required so files whose names start with `_` are NOT +// silently excluded by go:embed's default rules. Vite/rolldown emits +// `_plugin-vue_export-helper-.js` for the @vitejs/plugin-vue +// runtime; without `all:` the chunk would be missing from the binary +// at runtime → 404 → blank-page boot failure. +// +//go:embed all:dist var distFS embed.FS var startTime = time.Now()