sug
Explore posts from serversCDCloudflare Developers
•Created by sug on 3/6/2025 in #general-help
Wrangler: hunting down bad promise leading to "hanging promise cancelled" message
I'm currently in the process of transferring my SvelteKit app from Vercel to Cloudflare Pages.
When I go through the auth flow on the actual deployment, it's throwing an Error 1101 "Worker threw exception." So I've been trying to debug locally with
Somewhere in my layout functions, hooks, or auth flow, there's a promise that Wrangler can't resolve. But I can't figure out where that is. Any tips on how to find it? I think it's in a package that makes db calls, either kysely or @supabase/ssr
wrangler pages dev
and in my terminal console I'm getting the 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.
My browser is showing the following message instead of any html: Error: The script will never generate a response. at async Object.fetch (file:///Users/msugarman/.nvm/versions/node/v23.9.0/lib/node_modules/wrangler/node_modules/miniflare/dist/src/workers/core/entry.worker.js:1029:22)
Somewhere in my layout functions, hooks, or auth flow, there's a promise that Wrangler can't resolve. But I can't figure out where that is. Any tips on how to find it? I think it's in a package that makes db calls, either kysely or @supabase/ssr
2 replies