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

Unexpected response code 431 in Vite Websocket #547

Closed
haoleanh opened this issue Jul 14, 2020 · 1 comment · Fixed by #9324
Closed

Unexpected response code 431 in Vite Websocket #547

haoleanh opened this issue Jul 14, 2020 · 1 comment · Fixed by #9324
Labels
enhancement New feature or request has workaround

Comments

@haoleanh
Copy link

Is your feature request related to a problem? Please describe.
If you run Vite serve in an environment relies on 3rd party Authentication that return too much cookies (exceeds Header Size 8kb), Vite websocket will return error "Error during WebSocket handshake: Unexpected response code: 431". This is due to NodeJS header size limitation in v10 (nodejs/node#24692), not Vite issue itself. A workaround for now is include flag --max-http-header-size in node script to bypass this.

Describe the solution you'd like
It would be nice if Vite documentation show this as a warning so everyone aware, took me a day to figure out what is wrong :D

Describe alternatives you've considered
I call Vite cli via a custom node script so I can put --max-http-header-size flag in the command

Additional context
image

@yyx990803 yyx990803 added the enhancement New feature or request label Jan 8, 2021
@gengjiawen
Copy link

gengjiawen commented Jul 8, 2022

I run into an issue on gitpod.io and vscode online, not sure same problem.
image

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request has workaround
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants