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: Better error logging in wrangler dev proxy logic #2244

Open
JoshFerge opened this issue Nov 20, 2022 · 4 comments
Open

🐛 BUG: Better error logging in wrangler dev proxy logic #2244

JoshFerge opened this issue Nov 20, 2022 · 4 comments
Labels
bug Something that isn't working pages Relating to Pages pages-dev Relating to `pages dev` command

Comments

@JoshFerge
Copy link

What version of Wrangler are you using?

2.4.2

What operating system are you using?

Mac

Describe the Bug

When using wrangler pages dev with the --proxy=PORT option, node, due to the resolution of localhost, will attempt to send this request to the ipv6 loopback address on node17+.

If a developer has their proxy frontend only listening on ipv4, the cloudflare worker will simply print [pages:err] Error: Could not proxy request: TypeError: fetch failed

This just cost me a good 2-3 hours thinking something was wrong with my webpack server. For future developers, a more verbose error message / allow us to specify the host of the proxy would be helpful here: https://github.com/cloudflare/wrangler2/blob/main/packages/wrangler/src/miniflare-cli/assets.ts#L42

@JoshFerge JoshFerge added the bug Something that isn't working label Nov 20, 2022
@JoshFerge
Copy link
Author

note: this also applies to SSL issues that i'm having.

@JacobMGEvans JacobMGEvans added the pages Relating to Pages label Jan 9, 2023
@JacobMGEvans JacobMGEvans removed the pages Relating to Pages label Jan 9, 2023
@JacobMGEvans
Copy link
Contributor

Sorry @nevikashah I read it wrong 😅

@BMorearty
Copy link

BMorearty commented Jan 18, 2023

This just cost me a good 2-3 hours ...

You're a faster debugger than I. Man, this just cost me 3-4 DAYS.

Cloudflare gang, please fix this. In addition to a good error message it would be great to let the developer specify that the name of the host they want to listen to. The error message should probably document that if you're using Node.js 17+, the process listening on the proxy port should probably listen on an IPv6 host like ::1.

@admah admah added pages Relating to Pages and removed pages Relating to Pages labels Jan 23, 2023
@penalosa penalosa added the pages Relating to Pages label Jun 30, 2023
@Sammy-T
Copy link

Sammy-T commented Oct 9, 2023

I'm running into this issue trying to run a local pages environment for a Hugo site.

Would it not be reasonable to have the CLI request 127.0.0.1 instead of localhost or to set the dns default result order to ipv4first?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something that isn't working pages Relating to Pages pages-dev Relating to `pages dev` command
Projects
Status: Backlog
Development

No branches or pull requests

10 participants