Skip to content

Commit

Permalink
fix: avoid SSR requests in waitForRequestIdle (#16246)
Browse files Browse the repository at this point in the history
  • Loading branch information
patak-dev authored Mar 24, 2024
1 parent 520bb89 commit 7093f77
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions packages/vite/src/node/server/transformRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -183,9 +183,14 @@ async function doTransform(
resolved,
)

const depsOptimizer = getDepsOptimizer(config, ssr)
if (!depsOptimizer?.isOptimizedDepFile(id)) {
server._registerRequestProcessing(id, () => result)
if (!ssr) {
// Only register client requests, server.waitForRequestsIdle should
// have been called server.waitForClientRequestsIdle. We can rename
// it as part of the environment API work
const depsOptimizer = getDepsOptimizer(config, ssr)
if (!depsOptimizer?.isOptimizedDepFile(id)) {
server._registerRequestProcessing(id, () => result)
}
}

return result
Expand Down

0 comments on commit 7093f77

Please sign in to comment.