-
-
Notifications
You must be signed in to change notification settings - Fork 6.2k
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
http proxy error ECONNRESET at TLSWrap.onStreamRead #4794
Comments
I have this issue too; but only on one Mac (M1) and not another (Intel). Will try to figure out what the difference is ASAP. |
OK, So a little more work and I have some findings that may or may not help find this. On my old Mac (Intel 6 core), with Node 14, I can only get this to happen if I just hit refresh on the proxy'd URL from Chrome several times in a row. With Node 16, it happens every time I load the proxy'd URL. On my new Mac (M1 Pro), I only have Node 16 installed, so I see it every load too. On a Windows computer, I don't have this issue at all. Other than this error, it actually works fine in all cases. Maybe just need some way to suppress the error? |
I found a workaround. It seems to be a bug in http-proxy related to this issue: http-party/node-http-proxy#1496 This patch from 7 years ago does not seem to be needed any longer but http-proxy hasn't been updated in 3 years. The solution is to set an Agent in the proxy which will avoid the close code being run. In my proxy.conf.ts: import https from 'https'
const proxy = {
target,
secure: false,
agent: new https.Agent()
} With that code in place, I no longer get the errors. If you're not using https, use |
What is target in this snippet?
|
This might be unrelated, but im having similar problems on a Vue project (without vite?) and Node v17, here my system info if it helps you:
|
I use |
Hello @steveoh. Please provide a minimal reproduction using a GitHub repository or StackBlitz. Issues marked with |
Describe the bug
When using the vite proxy every request that goes through it throws
The request succeeds but the console is cluttered by these logs.
In my research, I've seen that this can be an issue with many parts of the equation (nodejs, the api, etc) and I did try to chat in discord but it seems a bit too specific to get any interest. If this isn't a bug in vite, I would appreciate some tips with my configuration or items to check for with the api or nodejs versions. This would be useful information for the docs once solved.
Reproduction
I a using a dotnet core 5 api with the vite configuration of
dotnet new webapi
System Info
System: OS: macOS 11.5.2 CPU: (16) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz Memory: 853.84 MB / 32.00 GB Shell: 5.8 - /bin/zsh Binaries: Node: 16.8.0 - /usr/local/bin/node npm: 7.21.0 - /usr/local/bin/npm Browsers: Chrome: 92.0.4515.159 Firefox: 90.0.2 Safari: 14.1.2 npmPackages: vite: ^2.5.1 => 2.5.1
Used Package Manager
npm
Logs
No response
Validations
The text was updated successfully, but these errors were encountered: