Commit 8230b13
authored
fix(docs): serialize prerender so large pages aren't truncated (#44)
The SPA prerender defaults to os.cpus().length concurrency. Several routes
race through the in-process render server at once, and under that load a large
response body stream is cut at the first ~64KiB chunk before res.text() drains
it. Any page over 64KiB (e.g. /islands/charts, /reference/manifest) is then
written truncated, losing its trailing hydration <script> and shipping as dead,
non-interactive HTML. Which page loses the race varies per build and worsens on
high-core CD runners, so it slipped past local builds into production.
Set prerender.concurrency to 1 to remove the race, and add a postbuild guard
that fails the build if any prerendered page is missing its closing </html>.1 parent b05e455 commit 8230b13
2 files changed
Lines changed: 21 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| |||
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
57 | | - | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
58 | 70 | | |
59 | 71 | | |
60 | 72 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
50 | 57 | | |
51 | 58 | | |
52 | 59 | | |
| |||
0 commit comments