Open
Description
Creating an AbortController
outside of the request context will throw an exception even if not used Disallowed operation called within global scope. Asynchronous I/O (ex: fetch() or connect()), setting a timeout, and generating random values are not allowed within global scope. To fix this error, perform this operation within a handler
It could cause issue, especially while bundling other lib (for example opennextjs/opennextjs-cloudflare#441). It can even fail silently, like in the linked PR, making it very hard to debug
Not sure if this is the expected behavior or not.
const a = new AbortController()
addEventListener("fetch", event => {
event.respondWith(new Response("Hello World"));
});