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