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

Closed
JoshFerge opened this issue Nov 20, 2022 · 4 comments · Fixed by #7041
Closed

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

JoshFerge opened this issue Nov 20, 2022 · 4 comments · Fixed by #7041
Labels
bug Something that isn't working error-messaging Improving user facing error messages 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.

@lrapoport-cf lrapoport-cf moved this to Untriaged in workers-sdk Nov 22, 2022
@JacobMGEvans JacobMGEvans added the pages Relating to Pages label Jan 9, 2023
@JacobMGEvans JacobMGEvans moved this from Untriaged to Other in workers-sdk Jan 9, 2023
@JacobMGEvans JacobMGEvans removed the pages Relating to Pages label Jan 9, 2023
@github-project-automation github-project-automation bot moved this to Untriaged in workers-sdk Jan 9, 2023
@JacobMGEvans JacobMGEvans moved this from Untriaged to Backlog in workers-sdk 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
@penalosa penalosa removed this from workers-sdk 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?

@CarmenPopoviciu CarmenPopoviciu added the pages-dev Relating to `pages dev` command label Apr 24, 2024
@CarmenPopoviciu CarmenPopoviciu moved this from Backlog to Untriaged in workers-sdk May 8, 2024
@CarmenPopoviciu CarmenPopoviciu moved this from Untriaged to Backlog in workers-sdk Jun 10, 2024
@lrapoport-cf lrapoport-cf added the error-messaging Improving user facing error messages label Oct 21, 2024
@github-project-automation github-project-automation bot moved this from Backlog to Done in workers-sdk Oct 22, 2024
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 error-messaging Improving user facing error messages pages Relating to Pages pages-dev Relating to `pages dev` command
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

10 participants