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: default 0.0.0.0 wrangler dev address not routable in Windows #1652

Closed
Cherry opened this issue Aug 10, 2022 · 8 comments · Fixed by cloudflare/miniflare#332, #1670, #1881 or #1915
Closed
Assignees
Labels
bug Something that isn't working

Comments

@Cherry
Copy link
Contributor

Cherry commented Aug 10, 2022

What version of Wrangler are you using?

2.0.25

What operating system are you using?

Windows 10

Describe the Bug

When using wrangler dev or wrangler pages dev, you'll get output like this:

[pages:inf] Listening on 0.0.0.0:8788
[pages:inf] - http://0.0.0.0:8788

Previously, you could click on this and open up your browser without issue, as well as of course b opens this address too.

Unfortunately, at least within Windows, 0.0.0.0 isn't actually a routable address, and the browser throws a ERR_ADDRESS_INVALID error, and something like this:

It seems like this address may be routable in some OSes, but not Windows. This seems to be due to the changes in #1605

@Cherry Cherry added the bug Something that isn't working label Aug 10, 2022
@Skye-31 Skye-31 self-assigned this Aug 10, 2022
@awthwathje
Copy link

awthwathje commented Aug 10, 2022

Can confirm it's not routable in Windows, a simple fix could be using Listening on 127.0.0.1:8788 or Listening on localhost:8788 in the advertised URLs in the console. Or just change the default to one of these if it's easier.

@Cherry
Copy link
Contributor Author

Cherry commented Aug 10, 2022

Another solution here might be to print all of the available network adapters, like serve does:

   │   Serving!                                         │
   │                                                    │
   │   - Local:            http://localhost:3000        │
   │   - On Your Network:  http://192.168.50.240:3000   |

Or http-server:

npx http-server -a 0.0.0.0

Available on:
  http://192.168.50.240:8080
  http://127.0.0.1:8080
  http://192.168.96.1:8080
  http://172.29.160.1:8080

Windows probably isn't the only place that 0.0.0.0 won't be routable. This information could be determined from os.networkInterfaces().

@JacobMGEvans
Copy link
Contributor

JacobMGEvans commented Aug 11, 2022

@Skye-31 Since you are picking this up here is a reference to the recent PR that caused this issue in Windows, we need to be able to support the VM/Container environments as well which prefer the 0.0.0.0

reference: #1605

Cc: @WalshyDev since you were on that PR too 😄

@Skye-31
Copy link
Contributor

Skye-31 commented Aug 11, 2022

My plan is to list all available addresses, so this should cover that 🙂
Will probably get around to this tomorrow

@awthwathje
Copy link

awthwathje commented Aug 11, 2022

@JacobMGEvans I filed the original issue you mentioned, and just wanted to give my two cents and to confirm what @Skye-31 said, that keeping the 0.0.0.0 as default while advertising all the available addresses locally in console will suit both local and remote users, including those of us using VMs. 👍

@Skye-31
Copy link
Contributor

Skye-31 commented Aug 12, 2022

Created 2 PRs. One solves the b button opening 0.0.0.0, in wrangler. The other solves the console log issue. Once those are both merged, will close this

@petebacondarwin
Copy link
Contributor

Re-opening this as the issue of what is displayed to the user is only fixed in local mode (i.e. in Miniflare) and not in remote mode (i.e. when using the proxy.ts code).

@Skye-31
Copy link
Contributor

Skye-31 commented Sep 18, 2022

@petebacondarwin, have also made a PR at #1881 to resolve this 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment