Skip to content

Commit

Permalink
fix(esbuild): check server before reload tsconfig (vitejs#11747)
Browse files Browse the repository at this point in the history
  • Loading branch information
bluwy authored and futurGH committed Feb 26, 2023
1 parent 6cf52c6 commit 35d0dd8
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/vite/src/node/plugins/esbuild.ts
Original file line number Diff line number Diff line change
Expand Up @@ -485,6 +485,8 @@ async function loadTsconfigJsonForFile(
}

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

0 comments on commit 35d0dd8

Please sign in to comment.