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);