nextlevelbuilder / nextlevelbuilder/goclaw
fix(ui): stale chunk 404 after redeployment — missing Cache-Control on index.html
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 3.6k
- Forks
- 1.1k
- Avg merge
- 3d 5h
- Merged PRs (30d)
- 24
Description
Problem
After redeploying the goclaw-ui container, users with a cached index.html get:
[ErrorBoundary] TypeError: Failed to fetch dynamically imported module:
https://hq.humanscale.app/assets/login-page-DrRJxksg.js
Root cause: Nginx serves index.html without Cache-Control headers, so browsers may cache it. After a rebuild, Vite generates new chunk hashes — the old index.html references chunks that no longer exist on the server.
Current Mitigations
lazyWithRetry()inlib/lazy-with-retry.tsretries once then force-reloads with a sessionStorage guard- Hashed assets in
/assets/are correctly served withCache-Control: public, immutable
Missing Fix
nginx.conf needs explicit no-cache headers for index.html to prevent browsers from caching the SPA entry point:
location = /index.html {
add_header Cache-Control "no-cache, no-store, must-revalidate";
add_header Pragma "no-cache";
add_header Expires "0";
}
Impact
- Users see a broken page after deploy until they hard-refresh
lazyWithRetryauto-reload helps but only fires once per session
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with nginx.conf and inspect how the SPA entry point is served alongside hashed assets. Add the specified no-cache headers for index.html, then verify the response headers after deployment and confirm that a redeployed UI no longer serves a cached entry point referencing missing chunks.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- nginx, vite
- Domain
- devops, frontend
- Issue type
- Bug
- Difficulty
- 1/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 86/100