You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jun 6, 2024. It is now read-only.
Hmm. Just tossing a single setTimeout(() => {}, 0) into an existing worker script seems to not break, but actually relying on a top-level timeout to do anything doesn't seem to work. I deployed this with wrangler and it didn't work, for example:
addEventListener("fetch",event=>{event.respondWith(handleRequest(event.request));});constprom=newPromise(resolve=>setTimeout(()=>{resolve("hello from async");},0));asyncfunctionhandleRequest(request){constdata=awaitprom;returnnewResponse(data,{status: 200});}
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Simple test case:
This works in cloudworker but fails in CF workers, with this error:
We should disallow the same behavior and add tests for all cases we can think of.
The text was updated successfully, but these errors were encountered: