@opennextjs/cloudflare 1.17.1 → 1.17.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -50,6 +50,23 @@ function loadManifest($PATH, $$$ARGS) {
50
50
  return process.env.NEXT_BUILD_ID;
51
51
  }
52
52
  ${returnManifests}
53
+ // Known optional manifests \u2014 Next.js loads these with handleMissing: true
54
+ // (see vercel/next.js packages/next/src/server/route-modules/route-module.ts).
55
+ // Return {} to match Next.js behaviour instead of crashing the worker.
56
+ // Note: Some manifest constants in Next.js omit the .json extension
57
+ // (e.g. SUBRESOURCE_INTEGRITY_MANIFEST, DYNAMIC_CSS_MANIFEST), so we
58
+ // strip .json before matching to handle both forms.
59
+ {
60
+ const p = $PATH.replace(/\\.json$/, "");
61
+ if (p.endsWith("react-loadable-manifest") ||
62
+ p.endsWith("subresource-integrity-manifest") ||
63
+ p.endsWith("server-reference-manifest") ||
64
+ p.endsWith("dynamic-css-manifest") ||
65
+ p.endsWith("fallback-build-manifest") ||
66
+ p.endsWith("prefetch-hints")) {
67
+ return {};
68
+ }
69
+ }
53
70
  throw new Error(\`Unexpected loadManifest(\${$PATH}) call!\`);
54
71
  }`,
55
72
  };
@@ -87,6 +104,11 @@ function evalManifest($PATH, $$$ARGS) {
87
104
  function evalManifest($PATH, $$$ARGS) {
88
105
  $PATH = $PATH.replaceAll(${JSON.stringify(sep)}, ${JSON.stringify(posix.sep)});
89
106
  ${returnManifests}
107
+ // client-reference-manifest is optional for static metadata routes
108
+ // (see vercel/next.js route-module.ts, loaded with handleMissing: true)
109
+ if ($PATH.endsWith("_client-reference-manifest.js")) {
110
+ return { __RSC_MANIFEST: {} };
111
+ }
90
112
  throw new Error(\`Unexpected evalManifest(\${$PATH}) call!\`);
91
113
  }`,
92
114
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@opennextjs/cloudflare",
3
3
  "description": "Cloudflare builder for next apps",
4
- "version": "1.17.1",
4
+ "version": "1.17.2",
5
5
  "type": "module",
6
6
  "bin": {
7
7
  "opennextjs-cloudflare": "dist/cli/index.js"