fix: use file copy instead of symlink for Blazor WASM runtime compatibility
TaxBaik CI/CD / build-and-deploy (push) Successful in 2m28s

Problem: ASP.NET Core static files middleware may not handle symlinks correctly,
causing blazor.web.js to be served as a 21-byte stub instead of the full 60KB file.
This caused 'SyntaxError: Invalid or unexpected token' in browser.

Solution: Replace symlink with actual file copy in deploy_gb.sh:
- cp blazor.webassembly.js blazor.web.js (+ .gz and .br variants)

This ensures both filenames are actual files that the static files middleware
can properly serve.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-07-03 12:20:15 +09:00
parent 3d0cf1132c
commit 32029bff92
+11 -3
View File
@@ -64,10 +64,18 @@ fi
# 3.5 Fix Blazor WASM runtime filename mismatch
# ASP.NET Core 10 uses blazor.webassembly.js but pages reference blazor.web.js
# Use file copy instead of symlink because ASP.NET Core static files may not handle symlinks correctly
echo "=== Fixing Blazor WASM Runtime Filename ==="
if [ -f "$DEPLOY_DIR/wwwroot/_framework/blazor.webassembly.js" ] && [ ! -f "$DEPLOY_DIR/wwwroot/_framework/blazor.web.js" ]; then
ln -s blazor.webassembly.js "$DEPLOY_DIR/wwwroot/_framework/blazor.web.js"
echo "✓ Created symlink: blazor.web.js -> blazor.webassembly.js"
FRAMEWORK_DIR="$DEPLOY_DIR/wwwroot/_framework"
if [ -f "$FRAMEWORK_DIR/blazor.webassembly.js" ]; then
cp "$FRAMEWORK_DIR/blazor.webassembly.js" "$FRAMEWORK_DIR/blazor.web.js"
if [ -f "$FRAMEWORK_DIR/blazor.webassembly.js.gz" ]; then
cp "$FRAMEWORK_DIR/blazor.webassembly.js.gz" "$FRAMEWORK_DIR/blazor.web.js.gz"
fi
if [ -f "$FRAMEWORK_DIR/blazor.webassembly.js.br" ]; then
cp "$FRAMEWORK_DIR/blazor.webassembly.js.br" "$FRAMEWORK_DIR/blazor.web.js.br"
fi
echo "✓ Copied blazor.web.js and variants"
fi
# 4. Start the new app on the target port