Skip to content

Instantly share code, notes, and snippets.

@unlocomqx
Created May 14, 2024 00:53
Show Gist options
  • Save unlocomqx/6a05de58fba816cff4db9d030b9a68ea to your computer and use it in GitHub Desktop.
Save unlocomqx/6a05de58fba816cff4db9d030b9a68ea to your computer and use it in GitHub Desktop.
Possible issue with cloudflare workers caused by a canceled promise
Hi 👋
I'm not entirely sure of the exact cause of this issue but I created a minimal repro. maybe someone can pinpoint the source of the issue.
Here's the repo
https://github.com/unlocomqx/cloudflare-error-1101
Here's the deploy to see the issue directly
https://b8aef2ad.cloudflare-error-1101.pages.dev/db
![CleanShot 2024-05-14 at 01 48 36@2x](https://github.com/porsager/postgres/assets/793712/0d1de0b7-56c7-40a1-9b9c-b2b6af524555)
The repo also has instructions to see the issue locally
![CleanShot 2024-05-14 at 01 48 11@2x](https://github.com/porsager/postgres/assets/793712/34e495fb-571a-418c-8549-b01364aeaa0f)
Here's the error from wrangler
<details><summary>Error</summary>
✘ [ERROR] A hanging Promise was canceled. This happens when the worker runtime is waiting for a Promise from JavaScript to resolve, but has detected that the Promise cannot possibly ever resolve because all code and events related to the Promise's I/O context have already finished.
✘ [ERROR] Uncaught (in response) Error: The script will never generate a response.
</details>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment