Skip to content

Commit c56b954

Browse files
authored
fix(esbuild): check server before reload tsconfig (#11747)
1 parent 193d55c commit c56b954

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

packages/vite/src/node/plugins/esbuild.ts

+2
Original file line numberDiff line numberDiff line change
@@ -485,6 +485,8 @@ async function loadTsconfigJsonForFile(
485485
}
486486

487487
function reloadOnTsconfigChange(changedFile: string) {
488+
// server could be closed externally after a file change is detected
489+
if (!server) return
488490
// any tsconfig.json that's added in the workspace could be closer to a code file than a previously cached one
489491
// any json file in the tsconfig cache could have been used to compile ts
490492
if (

0 commit comments

Comments
 (0)