@@ -146,9 +146,14 @@ async function populateR2IncrementalCache(
146146 quoteShellMeta ( normalizePath ( path . join ( bucket , cacheKey ) ) ) ,
147147 `--file ${ quoteShellMeta ( fullPath ) } ` ,
148148 ] ,
149- // NOTE: R2 does not support the environment flag and results in the following error:
150- // Incorrect type for the 'cacheExpiry' field on 'HttpMetadata': the provided value is not of type 'date'.
151- { target : populateCacheOptions . target , logging : "error" }
149+ {
150+ target : populateCacheOptions . target ,
151+ configPath : populateCacheOptions . configPath ,
152+ // R2 does not support the environment flag and results in the following error:
153+ // Incorrect type for the 'cacheExpiry' field on 'HttpMetadata': the provided value is not of type 'date'.
154+ environment : undefined ,
155+ logging : "error" ,
156+ }
152157 ) ;
153158 }
154159 logger . info ( `Successfully populated cache with ${ assets . length } assets` ) ;
@@ -193,7 +198,9 @@ async function populateKVIncrementalCache(
193198 writeFileSync ( chunkPath , JSON . stringify ( kvMapping ) ) ;
194199
195200 runWrangler ( options , [ "kv bulk put" , quoteShellMeta ( chunkPath ) , `--binding ${ KV_CACHE_BINDING_NAME } ` ] , {
196- ...populateCacheOptions ,
201+ target : populateCacheOptions . target ,
202+ environment : populateCacheOptions . environment ,
203+ configPath : populateCacheOptions . configPath ,
197204 logging : "error" ,
198205 } ) ;
199206
@@ -222,7 +229,12 @@ function populateD1TagCache(
222229 D1_TAG_BINDING_NAME ,
223230 `--command "CREATE TABLE IF NOT EXISTS revalidations (tag TEXT NOT NULL, revalidatedAt INTEGER NOT NULL, UNIQUE(tag) ON CONFLICT REPLACE);"` ,
224231 ] ,
225- { ...populateCacheOptions , logging : "error" }
232+ {
233+ target : populateCacheOptions . target ,
234+ environment : populateCacheOptions . environment ,
235+ configPath : populateCacheOptions . configPath ,
236+ logging : "error" ,
237+ }
226238 ) ;
227239
228240 logger . info ( "\nSuccessfully created D1 table" ) ;
0 commit comments