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
[WebServer] node:internal/http2/core:2762
throw new ERR_HTTP2_INVALID_STREAM();
^
Error [ERR_HTTP2_INVALID_STREAM]: The stream has been destroyed
at ServerHttp2Stream.respond (node:internal/http2/core:2762:13)
at [begin-send] (node:internal/http2/compat:836:19)
at Http2ServerResponse.writeHead (node:internal/http2/compat:711:21)
at start (file:///builds/<some-path>/node_modules/vite/dist/node/chunks/dep-ErEj4WmL.js:65537:23)
at res.write (file:///builds/<some-path>/node_modules/vite/dist/node/chunks/dep-ErEj4WmL.js:65552:17)
at ReadStream.ondata (node:internal/streams/readable:985:22)
at ReadStream.emit (node:events:514:28)
at addChunk (node:internal/streams/readable:545:12)
at readableAddChunkPushByteMode (node:internal/streams/readable:495:3)
at Readable.push (node:internal/streams/readable:375:5) {
code: 'ERR_HTTP2_INVALID_STREAM'
}
Unfortunately I haven't been able to reproduce this in a stable fashion either locally or in CI. And before finding a work around (more on that below) we just restarted the tests and that (🤞) works most of the time.
As a workaround we run vite preview using pm2 which seems to work since the server at leasts restarts on exceptions.
Since I know little about streams I'm not sure how to remedy the situation... but the first things that spring to my mind is:
try-catch res.writeHeader call?
check if stream is destroyed (somehow) before calling res.writeHead?
But I'm sure someone with better understanding of streams can come up with better solutions 🙏
Thankful for any help I can get!
Initially I intended to create a issue but considering I cant come up with a reproduction that is stable, I turn to you 😊
Unfortunately the tests need to run on https (using vite-plugin-mkcert) because interacting with our identity provider requires it (to be able to test silent sign in features).
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
👋
I have an issue where our end-to-end tests sometimes crash because
vite preview
throwsERR_HTTP2_INVALID_STREAM
.We run the tests using Playwright on GitLab pipelines in the
mcr.microsoft.com/playwright:v1.40.1-jammy
-image.System info
A semi-complete log of this exception
Unfortunately I haven't been able to reproduce this in a stable fashion either locally or in CI. And before finding a work around (more on that below) we just restarted the tests and that (🤞) works most of the time.
It seems like the exception stems from this code:
As a workaround we run
vite preview
usingpm2
which seems to work since the server at leasts restarts on exceptions.Since I know little about streams I'm not sure how to remedy the situation... but the first things that spring to my mind is:
res.writeHeader
call?res.writeHead
?But I'm sure someone with better understanding of streams can come up with better solutions 🙏
Thankful for any help I can get!
Initially I intended to create a issue but considering I cant come up with a reproduction that is stable, I turn to you 😊
Beta Was this translation helpful? Give feedback.
All reactions