[Bug] Dockerfile suppresses frontend build errors and serves broken unbundled HTML #1
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
In
docker/Dockerfile.frontend, the build command swallows build failures:RUN npm run build || (mkdir -p dist && cp index.html dist/index.html)When
npm run buildfails (due to TypeScript or bundling errors), Docker continues building and copies the raw developmentindex.htmlto/usr/share/nginx/html.Impact
/and/src/main.tsx(via Nginx SPA fallback).Unexpected token '<'), displaying a blank white screen with no container-level errors in logs.Steps to Reproduce
frontend/src/.docker compose -f docker-compose.prod.yaml build frontend.Expected Behavior
The Docker build step must fail immediately if
npm run buildexits with a non-zero code.