# v399.1 — CORI Mail Chunk-Load Deployment Hardening Status: Corrective deployment hardening Product UI impact: None Prisma impact: None ## Why this corrective package exists After v399, `/cori/mail` showed a browser application error before the page could render. The browser console showed `ChunkLoadError` and a failed request for the compiled CORI Mail page chunk under `/_next/static/chunks/app/(dashboard)/cori/mail/...`. That pattern indicates the browser could not load the compiled Next.js page chunk. It is different from a normal CORI Mail component error because the page JavaScript failed to load before the component could run. The safest correction is to harden the deployment command so the server does not serve a mixed or stale Next.js build. ## What changed - Added `scripts/dispatchspot-deploy-cleanup-v399-1.mjs`. - Added `scripts/dispatchspot-post-build-restart-v399-1.mjs`. - Added npm scripts for those two deployment steps. - Updated the operating manual so future WHM commands clear stale Next build output before build and restart the cPanel/Passenger Node process after build. - Updated active build rules and handoff notes with the chunk-load deployment hardening rule. ## Deployment rule added When a build changes app routes or client components, especially pages under the Next App Router, the WHM command should avoid serving mixed chunks by using this order: 1. unzip visibly; 2. remove old `.next` build output; 3. run preflight; 4. run Next build; 5. touch `tmp/restart.txt` so the running app process reloads the new build. This does not change product behavior. It only improves deployment reliability. ## What did not change - No CORI Mail UI behavior was changed. - No provider setup was moved. - No SMTP credentials, provider diagnostics, or raw delivery logs were exposed. - No Prisma schema was changed.