-
-
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
Parse Error: Expected HTTP #9172
Labels
p3-minor-bug
An edge case that only affects very specific usage (priority)
Comments
sapphi-red
added
the
p3-minor-bug
An edge case that only affects very specific usage (priority)
label
Jul 17, 2022
sapphi-red
added a commit
to sapphi-red/vite
that referenced
this issue
Jul 17, 2022
9 tasks
patak-dev
pushed a commit
that referenced
this issue
Jul 17, 2022
Version 3.0.1 did not fix the crash. [vite] http proxy error:
Error: Parse Error: Expected HTTP/
at Socket.socketOnData (node:_http_client:521:22)
at Socket.emit (node:events:513:28)
at addChunk (node:internal/streams/readable:324:12)
at readableAddChunk (node:internal/streams/readable:297:9)
at Readable.push (node:internal/streams/readable:234:10)
at TCP.onStreamRead (node:internal/stream_base_commons:190:23)
node:_http_outgoing:603
throw new ERR_HTTP_HEADERS_SENT('set');
^
Error [ERR_HTTP_HEADERS_SENT]: Cannot set headers after they are sent to the client
at new NodeError (node:internal/errors:387:5)
at ServerResponse.setHeader (node:_http_outgoing:603:11)
at ServerResponse.writeHead (node:_http_server:330:21)
at ProxyServer.<anonymous> (file:///Users/pasi/nc/nc-designer/node_modules/.pnpm/vite@3.0.1_sass@1.53.0/node_modules/vite/dist/node/chunks/dep-10d8d214.js:56975:26)
at ProxyServer.emit (file:///Users/pasi/nc/nc-designer/node_modules/.pnpm/vite@3.0.1_sass@1.53.0/node_modules/vite/dist/node/chunks/dep-10d8d214.js:55148:28)
at ClientRequest.proxyError (file:///Users/pasi/nc/nc-designer/node_modules/.pnpm/vite@3.0.1_sass@1.53.0/node_modules/vite/dist/node/chunks/dep-10d8d214.js:56490:18)
at ClientRequest.emit (node:events:513:28)
at Socket.socketOnData (node:_http_client:530:9)
at Socket.emit (node:events:513:28)
at addChunk (node:internal/streams/readable:324:12) {
code: 'ERR_HTTP_HEADERS_SENT'
} |
sapphi-red
added a commit
to sapphi-red/vite
that referenced
this issue
Jul 18, 2022
9 tasks
patak-dev
pushed a commit
that referenced
this issue
Jul 18, 2022
Vite 3.0.2 does not crash and it works, still the same error as in Vite 2. [vite] http proxy error:
Error: Parse Error: Expected HTTP/
at Socket.socketOnData (node:_http_client:521:22)
at Socket.emit (node:events:513:28)
at addChunk (node:internal/streams/readable:324:12)
at readableAddChunk (node:internal/streams/readable:297:9)
at Readable.push (node:internal/streams/readable:234:10)
at TCP.onStreamRead (node:internal/stream_base_commons:190:23) |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Describe the bug
Vite 3 crashes when getting a big proxy answer.
Trouble is a long answer, Content-Length: 426151, Content-Encoding: gzip. Uncompressed json length is 7024908.
This is my Vite proxy config:
Wireshark follow-http:
I found this: https://stackoverflow.com/questions/67462137/why-does-this-http-response-stream-yield-a-parsing-error
I guess Vite should handle this situation?
Vite 2 gives proxy error too, but it works and does not crash.
Reproduction
System Info
Used Package Manager
pnpm
Logs
No response
Validations
The text was updated successfully, but these errors were encountered: