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

fix: Use 127.0.0.1 to fix vite proxy error #1

Closed
wants to merge 1 commit into from

Conversation

kamal
Copy link
Owner

@kamal kamal commented Aug 30, 2024

What does this PR do?

Forces node to use ipv4 when proxying in dev mode. node 17 and above prefers to resolve localhost as ipv6. This causes vite proxy to fail because our backend server is bound to an ipv4 address. The error looks like this

[GUI] 4:43:19 PM [vite] http proxy error: /v1/flags
[GUI] Error: connect ECONNREFUSED ::1:3000
[GUI]     at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1555:16)

Notice the ::1 address.

Fixes # (issue)

@kamal kamal changed the title Use 127.0.0.1 to fix vite proxy error fix: Use 127.0.0.1 to fix vite proxy error Aug 30, 2024
@kamal kamal closed this Sep 1, 2024
@kamal kamal deleted the km/fix-vite-proxy-localhost branch September 1, 2024 17:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant