Commit 7292904
committed
fix(web): 404 missing build assets instead of serving index.html
The SPA fallback caught /assets/ too, so a browser still running an
index.html from before a deploy asked for a chunk hash that no longer
existed and got 200 text/html back. The module import then failed on
HTML it tried to parse as JavaScript and the app rendered its error
page — with nothing in the server logs, because every response was a
200. Reproduced by requesting any nonexistent chunk.
Hashed assets now answer 404 when missing, which makes the stale-client
case visible rather than disguising it as a broken app, and index.html
is marked no-cache so the browser stops pointing at the previous
deploy's chunk hashes in the first place.
Verified with `nginx -t` against the pinned nginx:1.31-alpine image.
Claude-Session: https://claude.ai/code/session_01XvVRm84RrH9APR25g8pFXt1 parent 2ae4f2d commit 7292904
1 file changed
Lines changed: 21 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
29 | 47 | | |
30 | 48 | | |
31 | 49 | | |
32 | 50 | | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
33 | 54 | | |
34 | 55 | | |
35 | 56 | | |
| |||
0 commit comments