From fcde4fcd834dff1faf9761fc7239c9213a2a6edb Mon Sep 17 00:00:00 2001 From: Dario Piotrowicz Date: Sun, 7 Jan 2024 13:41:53 +0100 Subject: [PATCH] resolve singlerWorkerScriptPath --- .changeset/eighty-hotels-train.md | 5 +++++ packages/wrangler/src/pages/dev.ts | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 .changeset/eighty-hotels-train.md diff --git a/.changeset/eighty-hotels-train.md b/.changeset/eighty-hotels-train.md new file mode 100644 index 000000000000..18ddd0e0a5b1 --- /dev/null +++ b/.changeset/eighty-hotels-train.md @@ -0,0 +1,5 @@ +--- +"wrangler": patch +--- + +make sure the script path is correctly resolved in `pages dev` when no directory is specified diff --git a/packages/wrangler/src/pages/dev.ts b/packages/wrangler/src/pages/dev.ts index d06e052c6c88..dd60b1bf6038 100644 --- a/packages/wrangler/src/pages/dev.ts +++ b/packages/wrangler/src/pages/dev.ts @@ -291,7 +291,7 @@ export const Handler = async ({ const workerScriptPath = directory !== undefined ? join(directory, singleWorkerScriptPath) - : singleWorkerScriptPath; + : resolve(singleWorkerScriptPath); const usingWorkerDirectory = existsSync(workerScriptPath) && lstatSync(workerScriptPath).isDirectory(); const usingWorkerScript = existsSync(workerScriptPath);