Promise will never complete
We're seeing an error
Promise will never complete
in logs but cannot locate the code and am not sure what can cause it.
I saw this comment in a conversation with @kenton https://discord.com/channels/595317990191398933/773219443911819284/868646357425086585
But still cannot recreate this error.
A simple return await new Promise(() => {})
yields the eponomous The script will never generate a response
(https://zuplo.com/blog/the-script-will-never-generate-a-response-on-cloudflare-workers/) error. Which seems distinct.
Any ideas what could cause this?2 Replies
The main culprit is that a given request is waiting on a promise that is from another request
The request has no I/O itself, but hasn't returned a response, so it's deemed as permanently hung & killed
tl;dr global scope bad
In my testing, that results in a different error
The script will never generate a response
- not Promise will never complete
. Are you sure the cause isn't different?