From 85ceb84c474a20b191a475719196eed9674a8e77 Mon Sep 17 00:00:00 2001 From: nrgnrg Date: Wed, 2 Feb 2022 12:45:03 +0000 Subject: [PATCH] fix: pages advanced mode usage --- .changeset/many-eggs-deny.md | 9 +++++++++ packages/wrangler/src/pages.tsx | 3 ++- 2 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 .changeset/many-eggs-deny.md diff --git a/.changeset/many-eggs-deny.md b/.changeset/many-eggs-deny.md new file mode 100644 index 000000000000..2ed3898e1cc6 --- /dev/null +++ b/.changeset/many-eggs-deny.md @@ -0,0 +1,9 @@ +--- +"wrangler": patch +--- + +fix: pages advanced mode usage + +Previously in pages projects using advanced mode (a single `_worker.js` or `--script-path` file rather than a `./functions` folder), calling `pages dev` would quit without an error and not launch miniflare. + +This change fixes that and enables `pages dev` to be used with pages projects in advanced mode. diff --git a/packages/wrangler/src/pages.tsx b/packages/wrangler/src/pages.tsx index da0fb5052979..734eec1b9b92 100644 --- a/packages/wrangler/src/pages.tsx +++ b/packages/wrangler/src/pages.tsx @@ -830,6 +830,8 @@ export const pages: BuilderCallback = (yargs) => { scriptPath, }; } else { + scriptReadyResolve(); + const scriptPath = directory !== undefined ? join(directory, singleWorkerScriptPath) @@ -852,7 +854,6 @@ export const pages: BuilderCallback = (yargs) => { } }`, }; - scriptReadyResolve(); } }