workers-sdk: 🐛 BUG: Starting inspector on 0.0.0.0:9229 failed: address already in use

What version of Wrangler are you using?

2.0.26

What operating system are you using?

Pop!_OS 22.04 LTS

Describe the Bug

run pnpm wrangler pages dev -- next dev in next.js project folder. trying to run with --inspector-port and different port, same result. checked with netstat, port 9229 and any different ports that i tried not in use. wrangler did working (serve proxy next dev and /functions).

other software version details: node 16.17.0 with nvm 0.39.1 pnpm 7.9.3

About this issue

  • Original URL
  • State: open
  • Created 2 years ago
  • Reactions: 15
  • Comments: 19 (5 by maintainers)

Most upvoted comments

i’m still seeing this on wrangler dev --local on 2.2.1. no matter the port supplied either via --inspector-port or the inspector_port value in the wrangler.toml, the address is always considered in use when there is nothing running on the provided port

still seeing with wrangler 2.1.11 on macOS 12.6

I also see this error in the latest wrangler 2.1.8 (and all recent versions before I tested).

I solved it with add –ip ‘127.0.0.1’.

wrangler pages dev . --ip '127.0.0.1'

We’d fixed this problem for plain Worker development, might not have added it to the pages commands. I’ll have a look.

Seeing this issue with Wrangler 3 as well. Exact same issue and message that @FunPineapple described. Windows, WSL.

npx wrangler dev pages public results in:

*** Fatal uncaught kj::Exception: kj/async-io-unix.c++:945: failed: ::bind(sockfd, &addr.generic, addrlen): Address already in use; toString() = 127.0.0.1:87881502024

stack: 
/home/project/node_modules/@cloudflare/workerd-linux-64/bin/workerd@2e82fda 
/home/project/node_modules/@cloudflare/workerd-linux-64/bin/workerd@2e82d7f 
/home/project/node_modules/@cloudflare/workerd-linux-64/bin/workerd@2e80fe5 
/home/project/node_modules/@cloudflare/workerd-linux-64/bin/workerd@154ba55 
/home/project/node_modules/@cloudflare/workerd-linux-64/bin/workerd@154c3d0 
/home/project/node_modules/@cloudflare/workerd-linux-64/bin/workerd@150cfdd 
/home/project/node_modules/@cloudflare/workerd-linux-64/bin/workerd@1511d47 
/home/project/node_modules/@cloudflare/workerd-linux-64/bin/workerd@1511ac4 
/home/project/node_modules/@cloudflare/workerd-linux-64/bin/workerd@1511aac 
/home/project/node_modules/@cloudflare/workerd-linux-64/bin/workerd@2eb9858 
/home/project/node_modules/@cloudflare/workerd-linux-64/bin/workerd@2eb9449 
/home/project/node_modules/@cloudflare/workerd-linux-64/bin/workerd@2eb7708 
/home/project/node_modules/@cloudflare/workerd-linux-64/bin/workerd@2eb74ca 
/home/project/node_modules/@cloudflare/workerd-linux-64/bin/workerd@1502293 
/lib/x86_64-linux-gnu/libc.so.6@29d8f /lib/x86_64-linux-gnu/libc.so.6@29e3f 
/home/project/node_modules/@cloudflare/workerd-linux-64/bin/workerd@1502024