Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 BUG: Port 8787 in use fails, but doesn't exist #949

Closed
geelen opened this issue May 10, 2022 · 1 comment · Fixed by #951 or #954
Closed

🐛 BUG: Port 8787 in use fails, but doesn't exist #949

geelen opened this issue May 10, 2022 · 1 comment · Fixed by #951 or #954
Assignees

Comments

@geelen
Copy link
Contributor

geelen commented May 10, 2022

What version of Wrangler are you using?

2.0.2

What operating system are you using?

Mac

Describe the Bug

Had something else running on 8787, and running wrangler dev I got this:

image

for people googling:

⬣ Listening at http://localhost:8787
✘ [ERROR] 12:43:36 pm Error: listen EADDRINUSE: address already in use 127.0.0.1:8787

      at Server.setupListenHandle [as _listen2] (node:net:1334:16)
      at listenInCluster (node:net:1382:12)
      at GetAddrInfoReqWrap.doListen [as callback] (node:net:1520:7)
      at GetAddrInfoReqWrap.onlookup [as oncomplete] (node:dns:73:8) {
    code: 'EADDRINUSE',
    errno: -48,
    syscall: 'listen',
    address: '127.0.0.1',
    port: 8787
  }

If I hit b, I get a browser window open like nothing happened, it's just showing the wrong project.

Can this automatically jump to an open port? Or at least crash completely?

@geelen geelen added the bug label May 10, 2022
@petebacondarwin
Copy link
Contributor

Thanks for the issue @geelen - we were prematurely setting the configuration port value to the default of 8787 rather than doing it in the wrangler dev command, where it uses a library called getPort().

I have a fix coming within the hour.

@petebacondarwin petebacondarwin self-assigned this May 10, 2022
petebacondarwin added a commit to petebacondarwin/wrangler2 that referenced this issue May 10, 2022
…on is in use

Previously, we were only calling `getPort()` if the configured port was undefined.
But since we were setting the default for this during validation, it was never undefined.

Fixes [cloudflare#949](cloudflare#949)
petebacondarwin added a commit to petebacondarwin/wrangler2 that referenced this issue May 10, 2022
…one is in use

Previously, we were only calling `getPort()` if the configured port was undefined.
But since we were setting the default for this during validation, it was never undefined.

Fixes [cloudflare#949](cloudflare#949)
@petebacondarwin petebacondarwin added this to the 2.0 milestone May 10, 2022
petebacondarwin added a commit that referenced this issue May 10, 2022
…one is in use (#951)

* fix: look for an alternate port in the dev command if the configured one is in use

Previously, we were only calling `getPort()` if the configured port was undefined.
But since we were setting the default for this during validation, it was never undefined.

Fixes [#949](#949)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
2 participants