@@ -33,6 +33,7 @@ import {
33
33
BINDING_NAME as D1_TAG_BINDING_NAME ,
34
34
NAME as D1_TAG_NAME ,
35
35
} from "../../api/overrides/tag-cache/d1-next-tag-cache.js" ;
36
+ import { normalizePath } from "../build/utils/normalize-path.js" ;
36
37
import type { WranglerTarget } from "../utils/run-wrangler.js" ;
37
38
import { runWrangler } from "../utils/run-wrangler.js" ;
38
39
@@ -57,8 +58,8 @@ export function getCacheAssets(opts: BuildOptions): CacheAsset[] {
57
58
const assets : CacheAsset [ ] = [ ] ;
58
59
59
60
for ( const file of allFiles ) {
60
- const fullPath = file . fullpathPosix ( ) ;
61
- const relativePath = path . relative ( path . join ( opts . outputDir , "cache" ) , fullPath ) ;
61
+ const fullPath = file . fullpath ( ) ;
62
+ const relativePath = normalizePath ( path . relative ( path . join ( opts . outputDir , "cache" ) , fullPath ) ) ;
62
63
63
64
if ( relativePath . startsWith ( "__fetch" ) ) {
64
65
const [ __fetch , buildId , ...keyParts ] = relativePath . split ( "/" ) ;
@@ -121,7 +122,11 @@ function populateR2IncrementalCache(
121
122
122
123
runWrangler (
123
124
options ,
124
- [ "r2 object put" , JSON . stringify ( path . join ( bucket , cacheKey ) ) , `--file ${ JSON . stringify ( fullPath ) } ` ] ,
125
+ [
126
+ "r2 object put" ,
127
+ JSON . stringify ( normalizePath ( path . join ( bucket , cacheKey ) ) ) ,
128
+ `--file ${ JSON . stringify ( fullPath ) } ` ,
129
+ ] ,
125
130
// NOTE: R2 does not support the environment flag and results in the following error:
126
131
// Incorrect type for the 'cacheExpiry' field on 'HttpMetadata': the provided value is not of type 'date'.
127
132
{ target : populateCacheOptions . target , excludeRemoteFlag : true , logging : "error" }
0 commit comments