BUG: Frontend build/packaging fragility (custom Vite output + incomplete Dockerfile copy) #66
Reference in New Issue
Block a user
Delete Branch "%!s()"
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?
Description:
The frontend build and Docker packaging process (
client/vite.config.js+Dockerfile) is fragile and has already caused non-functional UI in v1.7.30. While partially improved in v1.7.31, it remains at risk of regression and does not follow standard practices.Detailed Investigation Findings (release/1.7.31)
1. Non-Standard Vite Configuration
build.outDir: '../public'(instead of standarddist/).rollupOptions.input: { main: './src/main.js' }+ forcedentryFileNames: 'app.js'.client/index.htmlstill references/src/main.jsx(non-existent file) — the build process must rewrite it, but this is brittle.emptyOutDir: false+ committed build artifacts inpublic/(index.html, app.js, style.css) create version control and reproducibility problems.2. Dockerfile Packaging Issues (Improved but Still Fragile)
/app/public/app.jsfrom client-build stage → missing processedindex.html, CSS, and other assets.public/copy, but still relies on the custom Vite output being perfect.client/and build output.3. Runtime Serving (
server/app.js)index.htmlpatching for CSP nonce +express.staticworks, but depends on the build producing a correctindex.htmlwith the right<script src="/app.js">.Impact:
Proposed Solution / Fix Plan:
dist/, let Vite handleindex.htmlprocessing normally.COPY --from=client-build /app/dist ./publicpublic/.package.jsonscripts to supportnpm run buildat root level.Cross-Dependencies:
Suggested Labels:
Kind/Bug, Priority: Medium, Area/Frontend, Area/Docker, Compat/Non-Breaking
Affected Versions: v1.7.21 – v1.7.31 (major breakage in 1.7.30).