diff --git a/src/runtime/entries/winterjs.ts b/src/runtime/entries/winterjs.ts index 2bdb11617f..7f1fb1579e 100644 --- a/src/runtime/entries/winterjs.ts +++ b/src/runtime/entries/winterjs.ts @@ -54,10 +54,8 @@ async function _handleEvent(event: FetchEvent) { } } -globalThis._handleEvent = _handleEvent; - -addEventListener("fetch", async (event) => { - return await globalThis._handleEvent(event as FetchEvent); +addEventListener("fetch", async (event: FetchEvent) => { + event.respondWith(await _handleEvent(event)); }); // ------------------------------