Commit 4e9c8aa
fix(nextcompile): serve root-level public/ files (install.sh, robots.txt) from R2
The dispatcher only consulted R2 for /_next/static/* and /public/*
prefixed paths, but Next.js serves files in public/ at the bare root
and the packager uploads them keyed by basename. As a result every
root-level public asset 404'd on Cloudflare Workers deploys —
including /install.sh, which made the curl|bash one-liner advertised
in the README dead on arrival.
Add serveRootPublicFromR2 in serve.mjs (gated on paths whose final
segment contains a '.' so we don't spend an R2 GET on every typo'd
route) and call it from dispatcher.mjs after route dispatch fails but
before notFound. /install.sh, /install.bat, /daemon.sh, /robots.txt,
/favicon.ico, etc. now resolve via the public Cloudflare deploy.
Verified end-to-end: redeployed nextdeploy.org and confirmed
`curl -fsSL https://nextdeploy.org/install.sh | bash` now succeeds.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 685de5a commit 4e9c8aa
2 files changed
Lines changed: 32 additions & 2 deletions
File tree
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
| 15 | + | |
| 16 | + | |
16 | 17 | | |
17 | 18 | | |
18 | 19 | | |
| |||
23 | 24 | | |
24 | 25 | | |
25 | 26 | | |
26 | | - | |
| 27 | + | |
27 | 28 | | |
28 | 29 | | |
29 | 30 | | |
| |||
69 | 70 | | |
70 | 71 | | |
71 | 72 | | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
72 | 76 | | |
73 | 77 | | |
74 | 78 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
41 | 67 | | |
42 | 68 | | |
43 | 69 | | |
| |||
0 commit comments