Skip to content

Commit 4be2f4a

Browse files
committed
bug fix
1 parent 66d91a6 commit 4be2f4a

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

packages/cloudflare/src/cli/build/open-next/createServerBundle.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import {
1919
patchFetchCacheSetMissingWaitUntil,
2020
patchNextServer,
2121
patchUnstableCacheForISR,
22+
patchUseCacheForISR,
2223
} from "@opennextjs/aws/build/patch/patches/index.js";
2324
// TODO: import from patches/index.js when https://github.com/opennextjs/opennextjs-aws/pull/827 is released
2425
import { patchBackgroundRevalidation } from "@opennextjs/aws/build/patch/patches/patchBackgroundRevalidation.js";
@@ -209,6 +210,7 @@ async function generateBundle(
209210
patchFetchCacheSetMissingWaitUntil,
210211
patchFetchCacheForISR,
211212
patchUnstableCacheForISR,
213+
patchUseCacheForISR,
212214
patchNextServer,
213215
patchEnvVars,
214216
patchBackgroundRevalidation,
@@ -232,7 +234,11 @@ async function generateBundle(
232234
const isAfter141 = buildHelper.compareSemver(options.nextVersion, ">=", "14.1");
233235
const isAfter142 = buildHelper.compareSemver(options.nextVersion, ">=", "14.2");
234236

235-
const isAfter153 = buildHelper.compareSemver(options.nextVersion, ">=", "15.3.0");
237+
const isAfter152 = buildHelper.compareSemver(
238+
options.nextVersion,
239+
">=",
240+
"15.2.0",
241+
);
236242

237243
const disableRouting = isBefore13413 || config.middleware?.external;
238244

@@ -254,7 +260,7 @@ async function generateBundle(
254260
...(disableNextPrebundledReact ? ["requireHooks"] : []),
255261
...(isBefore13413 ? ["trustHostHeader"] : ["requestHandlerHost"]),
256262
...(isAfter141 ? ["experimentalIncrementalCacheHandler"] : ["stableIncrementalCache"]),
257-
...(isAfter153 ? [""] : ["composableCache"]),
263+
...(isAfter152 ? [""] : ["composableCache"]),
258264
],
259265
}),
260266

packages/cloudflare/src/cli/build/patches/investigated/patch-cache.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ export async function patchComposableCache(code: string, buildOpts: BuildOptions
3636

3737
// TODO: switch to cache.mjs
3838
const outputPath = path.join(outputDir, "server-functions/default");
39-
const cacheFile = path.join(outputPath, getPackagePath(buildOpts), "cache.cjs");
39+
const cacheFile = path.join(outputPath, getPackagePath(buildOpts), "composable-cache.cjs");
4040
//TODO: Do we want to move this to the new CodePatcher ?
4141
return code.replace(
4242
"const { cacheHandlers } = this.nextConfig.experimental",

packages/cloudflare/src/cli/build/patches/plugins/load-manifest.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export function inlineLoadManifest(updater: ContentUpdater, buildOpts: BuildOpti
1717
return updater.updateContent("inline-load-manifest", [
1818
{
1919
field: {
20-
filter: getCrossPlatformPathRegex(String.raw`/next/dist/server/load-manifest\.js$`, {
20+
filter: getCrossPlatformPathRegex(String.raw`/next/dist/server/load-manifest(\.external)?\.js$`, {
2121
escape: false,
2222
}),
2323
contentFilter: /function loadManifest\(/,

0 commit comments

Comments
 (0)