Skip to content

Commit 7b2ff7a

Browse files
committed
.
1 parent dbffa91 commit 7b2ff7a

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

packages/cloudflare/src/cli/build/patches/plugins/instrumentation.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ import { type BuildOptions, getPackagePath } from "@opennextjs/aws/build/helper.
55
import { patchCode } from "@opennextjs/aws/build/patch/astCodePatcher.js";
66
import type { ContentUpdater, Plugin } from "@opennextjs/aws/plugins/content-updater.js";
77

8+
import { normalizePath } from "../../utils/normalize-path.js";
9+
810
export function patchInstrumentation(updater: ContentUpdater, buildOpts: BuildOptions): Plugin {
911
const builtInstrumentationPath = getBuiltInstrumentationPath(buildOpts);
1012

@@ -84,7 +86,7 @@ function getBuiltInstrumentationPath(buildOpts: BuildOptions): string | null {
8486
getPackagePath(buildOpts),
8587
`.next/server/${INSTRUMENTATION_HOOK_FILENAME}.js`
8688
);
87-
return existsSync(maybeBuiltInstrumentationPath) ? maybeBuiltInstrumentationPath.replace(/\\/g, "/") : null;
89+
return existsSync(maybeBuiltInstrumentationPath) ? normalizePath(maybeBuiltInstrumentationPath) : null;
8890
}
8991

9092
/**

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ import {
3333
BINDING_NAME as D1_TAG_BINDING_NAME,
3434
NAME as D1_TAG_NAME,
3535
} from "../../api/overrides/tag-cache/d1-next-tag-cache.js";
36+
import { normalizePath } from "../build/utils/normalize-path.js";
3637
import type { WranglerTarget } from "../utils/run-wrangler.js";
3738
import { runWrangler } from "../utils/run-wrangler.js";
3839

@@ -58,7 +59,7 @@ export function getCacheAssets(opts: BuildOptions): CacheAsset[] {
5859

5960
for (const file of allFiles) {
6061
const fullPath = file.fullpathPosix();
61-
const relativePath = path.relative(path.join(opts.outputDir, "cache"), fullPath);
62+
const relativePath = normalizePath(path.relative(path.join(opts.outputDir, "cache"), fullPath));
6263

6364
if (relativePath.startsWith("__fetch")) {
6465
const [__fetch, buildId, ...keyParts] = relativePath.split("/");

0 commit comments

Comments
 (0)