Skip to content

Commit

Permalink
fix: handle warmup request error correctly (#16223)
Browse files Browse the repository at this point in the history
  • Loading branch information
sapphi-red authored Mar 21, 2024
1 parent d443428 commit d7c5256
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/vite/src/node/server/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,9 @@ export async function _createServer(
return transformRequest(url, server, options)
},
async warmupRequest(url, options) {
await transformRequest(url, server, options).catch((e) => {
try {
await transformRequest(url, server, options)
} catch (e) {
if (
e?.code === ERR_OUTDATED_OPTIMIZED_DEP ||
e?.code === ERR_CLOSED_SERVER
Expand All @@ -525,7 +527,7 @@ export async function _createServer(
error: e,
timestamp: true,
})
})
}
},
transformIndexHtml(url, html, originalUrl) {
return devHtmlTransformFn(server, url, html, originalUrl)
Expand Down

0 comments on commit d7c5256

Please sign in to comment.