From af238543c5523068945bda113fe6a5ac9cae962e Mon Sep 17 00:00:00 2001 From: kjh2064 Date: Sat, 4 Jul 2026 21:19:09 +0900 Subject: [PATCH] fix: restore WASM static file serving configuration MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reverted breaking changes from commit 08b002d (2026-07-04 20:28): 1. UseStaticFiles path mapping (reverted): - Before (c960860 - working): app.UseStaticFiles("/admin") - After (08b002d): app.UseStaticFiles(new StaticFileOptions { RequestPath = "/admin" }) - Now (fixed): app.UseStaticFiles("/admin") ✅ 2. Removed MapRazorComponents (blocking WASM): - app.MapRazorComponents<...>() was interfering with static file serving - Blazor WebAssembly should be pure static WASM, not server-side - Removed in favor of MapFallbackToFile pattern ✅ 3. Restored portal fallback: - Added app.MapFallbackToFile("portal/{*path:nonfile}", "portal/index.html") - Added root redirect: app.MapGet("/", ...) 4. Fixed index.html script path: - Before: (absolute) - After: (relative) - Relative path respects base href="/taxbaik/admin/" ✅ **Verification:** - WASM files (45KB+): ✅ Present, correct hash - Server delivery: ✅ 200 OK, correct SHA-256 - Static file serving: ✅ /taxbaik/admin/_framework/* accessible - Issue: blazor.boot.json still missing (blocks WASM initialization) **Status:** - Login form: ✅ Renders - WASM bootstrap script: ✅ Loads (with relative path fix) - WASM runtime: ❌ Blocked (needs blazor.boot.json) - Dashboard: ❌ Loading indefinitely Next: Investigate why blazor.boot.json is not generated in Debug build. Co-Authored-By: Claude Haiku 4.5 --- src/TaxBaik.Web/Program.cs | 11 +++++------ src/TaxBaik.Web/wwwroot/admin/index.html | 2 +- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/TaxBaik.Web/Program.cs b/src/TaxBaik.Web/Program.cs index ac0c877..b710050 100644 --- a/src/TaxBaik.Web/Program.cs +++ b/src/TaxBaik.Web/Program.cs @@ -370,8 +370,8 @@ app.UseResponseCompression(); // 정적 파일 제공 (WASM 프레임워크 파일 포함) app.UseStaticFiles(); -app.UseStaticFiles(new StaticFileOptions { RequestPath = "/admin" }); -app.UseStaticFiles(new StaticFileOptions { RequestPath = "/portal" }); +app.UseStaticFiles("/admin"); +app.UseStaticFiles("/portal"); app.UseSession(); // TempData 쿠키 저장소 app.UseRouting(); @@ -394,13 +394,12 @@ app.MapHealthChecks("/healthz"); app.MapRazorPages(); // Sitemap.cshtml, Rss.cshtml, Feed.cshtml app.MapStaticAssets(); -// Blazor WebAssembly Admin Client (WASM 파일 제공 필수) -app.MapRazorComponents() - .AddInteractiveWebAssemblyRenderMode() - .AllowAnonymous(); +// 루트 경로 기본값 +app.MapGet("/", () => Results.Redirect("/taxbaik/")); // SPA 라우팅 폴백 (가장 마지막에!) app.MapFallbackToFile("admin/{*path:nonfile}", "admin/index.html"); +app.MapFallbackToFile("portal/{*path:nonfile}", "portal/index.html"); // 애플리케이션 시작/종료 로깅 try diff --git a/src/TaxBaik.Web/wwwroot/admin/index.html b/src/TaxBaik.Web/wwwroot/admin/index.html index cd86638..92912e7 100644 --- a/src/TaxBaik.Web/wwwroot/admin/index.html +++ b/src/TaxBaik.Web/wwwroot/admin/index.html @@ -18,6 +18,6 @@ 🗙 - +