You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Proxying a network request through a port forward created by Garden has been reported to fail with the following error after we upgraded to Node 18:
[HPM] Error occurred while trying to proxy request *** from localhost:XXXX to localhost:XXXX (ECONNREFUSED)
This seems to happen when the client sending the network request uses Node's http-proxy-middleware and the target is localhost. Something like:
import{createProxyMiddleware}from"http-proxy-middleware"constproxy=createProxyMiddlewareI({target: "localhost:8080"// <--- Target is localhost})
Expected behavior
I would expect things to work as before, but maybe this is an issue in Node 18. Here's an SO thread that looks relevant and the suggestion is to use 127.0.0.1 instead of localhost.
So perhaps this is something that needs be handled by the user in the createProxyMiddleware function as opposed to by Garden.
Workaround
First, set the GARDEN_PROXY_DEFAULT_ADDRESS environment variable to 127.0.0.1. E.g.:
Bug
Current Behavior
Proxying a network request through a port forward created by Garden has been reported to fail with the following error after we upgraded to Node 18:
This seems to happen when the client sending the network request uses Node's
http-proxy-middleware
and the target is localhost. Something like:Expected behavior
I would expect things to work as before, but maybe this is an issue in Node 18. Here's an SO thread that looks relevant and the suggestion is to use
127.0.0.1
instead oflocalhost
.So perhaps this is something that needs be handled by the user in the
createProxyMiddleware
function as opposed to by Garden.Workaround
First, set the
GARDEN_PROXY_DEFAULT_ADDRESS
environment variable to 127.0.0.1. E.g.:Then make sure to use
127.0.0.1
as opposed tolocalhost
in thecreateProxyMiddleware
function as suggested on StackOveflow.Your environment
garden version
0.12.50.The text was updated successfully, but these errors were encountered: