Commit a143282
fix(patches): return empty object for unhandled manifests in loadManifest (#1151)
* fix: return empty object for unhandled manifests in loadManifest/evalManifest
* chore: add changeset for load-manifest fix
* fix: handle only known optional manifests instead of blanket catch-all
Address review feedback from @conico974 — instead of returning {} for all
unknown manifests (which would hide genuine errors), only handle the specific
manifests that Next.js loads with handleMissing: true.
loadManifest optional manifests (from vercel/next.js route-module.ts):
- react-loadable-manifest.json (Turbopack per-route)
- subresource-integrity-manifest.json (experimental.sri)
- server-reference-manifest.json (App Router only)
- dynamic-css-manifest.json (Pages Router + Webpack only)
- fallback-build-manifest.json (/_error page only)
evalManifest optional manifests:
- _client-reference-manifest.js (static metadata routes)
Everything else still throws to surface genuine errors.
* fix: handle extensionless manifests and add prefetch-hints
- Fix prettier formatting in changeset
- Strip .json extension before matching optional manifests since Next.js
defines some constants without it (SUBRESOURCE_INTEGRITY_MANIFEST,
DYNAMIC_CSS_MANIFEST, SERVER_REFERENCE_MANIFEST)
- Add prefetch-hints to the optional manifest list (new in Next.js 16.2)
- All 236 tests pass, tsc clean, prettier clean
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent bf33735 commit a143282
2 files changed
Lines changed: 49 additions & 0 deletions
File tree
- .changeset
- packages/cloudflare/src/cli/build/patches/plugins
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
Lines changed: 22 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
69 | 86 | | |
70 | 87 | | |
71 | 88 | | |
| |||
110 | 127 | | |
111 | 128 | | |
112 | 129 | | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
113 | 135 | | |
114 | 136 | | |
115 | 137 | | |
| |||
0 commit comments