Skip to content

Commit

Permalink
fix: don't interact with res if refresh has happened (#4370)
Browse files Browse the repository at this point in the history
  • Loading branch information
danielroe committed Jul 23, 2021
1 parent 2b5d587 commit c90b7d9
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/vite/src/node/server/middlewares/transform.ts
Expand Up @@ -76,6 +76,8 @@ export function transformMiddleware(
// something unexpected has happened. In this case, Vite
// returns an empty response that will error.
setTimeout(() => {
// Don't do anything if response has already been sent
if (res.writableEnded) return
// status code request timeout
res.statusCode = 408
res.end(
Expand Down

0 comments on commit c90b7d9

Please sign in to comment.