uncaught exception; source = Uncaught (in promise); stack = Error: Network connection lost.
All of a sudden I've started seeing errors whenever I try and run a worker locally. This include a simple "hello-world" worker. When I run it, no requests reach the worker. I added --log-level debug and I see a constant stream of exceptions that look like this:
exception = kj/async-io-unix.c++:1538: disconnected: connect(): Connection refused
As of a couple days ago this all worked fine, so I have no idea what changed. Anyone seen anything like this/have any ideas?
1 Reply
I tried something fresh via:
npm create cloudflare@latest -- worker-test
cd worker-test
npx wrangler dev --log-level debug
And that repros this for me.
wrangler.jsonc is:
I tried the same thing on another computer of mine and that seems to work, so it seems like some weird state on this machine? I tried wiping the .wrangler directory but no luck there.
This appears to be the root cause in the stack:
I ended up fixing this by passing --ip 127.0.0.1 when running npx wrangler dev. Definitely would've been nice to get an error message that made this a bit clearer
I have an ipv6 interface, so it may be that it was trying to bind there by default and that's what was causing this issue