Skip to content

http proxy error ECONNRESET at TLSWrap.onStreamRead #4794

@steveoh

Description

@steveoh

Describe the bug

When using the vite proxy every request that goes through it throws

10:46:37 AM [vite] http proxy error:
Error: read ECONNRESET
    at TLSWrap.onStreamRead (node:internal/stream_base_commons:220:20) (x8)

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

proxy: {
      '/api': {
        target: 'https://localhost:5001/',
        changeOrigin: true,
        secure: false,
        protocolRewrite: 'https',
        cookieDomainRewrite: 'localhost:3000',
      },
    },

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions