From d8ee04f343303e50c976b676cd06075a971081f2 Mon Sep 17 00:00:00 2001 From: Sunil Pai Date: Tue, 14 Jun 2022 19:14:21 +0100 Subject: [PATCH] fix: pass env and ctx to request handler when using `--experimental-public` (#1260) (as reported on discord) --- .changeset/tender-tables-fetch.md | 5 +++++ packages/wrangler/templates/static-asset-facade.js | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 .changeset/tender-tables-fetch.md diff --git a/.changeset/tender-tables-fetch.md b/.changeset/tender-tables-fetch.md new file mode 100644 index 000000000000..6fdd92c542e3 --- /dev/null +++ b/.changeset/tender-tables-fetch.md @@ -0,0 +1,5 @@ +--- +"wrangler": patch +--- + +fix: pass env and ctx to request handler when using `--experimental-public` diff --git a/packages/wrangler/templates/static-asset-facade.js b/packages/wrangler/templates/static-asset-facade.js index 8c932dceeb16..cb00ac3ee285 100644 --- a/packages/wrangler/templates/static-asset-facade.js +++ b/packages/wrangler/templates/static-asset-facade.js @@ -35,7 +35,7 @@ export default { } catch (e) { console.error(e); // if an error is thrown then serve from actual worker - return worker.fetch(request); + return worker.fetch(request, env, ctx); // TODO: throw here if worker is not available // (which implies it may be a service-worker) }