Skip to content

Commit 899bae0

Browse files
authored
fix cache population for R2 (#644)
1 parent d2a0a87 commit 899bae0

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

.changeset/violet-lemons-think.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@opennextjs/cloudflare": patch
3+
---
4+
5+
fix cache population for R2

packages/cloudflare/src/cli/commands/populate-cache.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ async function populateR2IncrementalCache(
125125
["r2 object put", quoteShellMeta(path.join(bucket, cacheKey)), `--file ${quoteShellMeta(fullPath)}`],
126126
// NOTE: R2 does not support the environment flag and results in the following error:
127127
// Incorrect type for the 'cacheExpiry' field on 'HttpMetadata': the provided value is not of type 'date'.
128-
{ target: populateCacheOptions.target, excludeRemoteFlag: true, logging: "error" }
128+
{ target: populateCacheOptions.target, logging: "error" }
129129
);
130130
}
131131
logger.info(`Successfully populated cache with ${assets.length} assets`);

packages/cloudflare/src/cli/utils/run-wrangler.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ export type WranglerTarget = "local" | "remote";
1111
type WranglerOptions = {
1212
target?: WranglerTarget;
1313
environment?: string;
14-
excludeRemoteFlag?: boolean;
1514
logging?: "all" | "error";
1615
};
1716

@@ -66,7 +65,7 @@ export function runWrangler(options: BuildOptions, args: string[], wranglerOpts:
6665
[
6766
...args,
6867
wranglerOpts.environment && `--env ${wranglerOpts.environment}`,
69-
wranglerOpts.target === "remote" && !wranglerOpts.excludeRemoteFlag && "--remote",
68+
wranglerOpts.target === "remote" && "--remote",
7069
wranglerOpts.target === "local" && "--local",
7170
].filter((v): v is string => !!v)
7271
),

0 commit comments

Comments
 (0)