Skip to content

Commit d35a1e2

Browse files
authoredAug 8, 2022
fix(config): try catch unlink after load (#9577)
1 parent c1fa219 commit d35a1e2

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed
 

‎packages/vite/src/node/config.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -1039,7 +1039,11 @@ async function loadConfigFromBundledFile(
10391039
try {
10401040
return (await dynamicImport(fileUrl)).default
10411041
} finally {
1042-
fs.unlinkSync(fileNameTmp)
1042+
try {
1043+
fs.unlinkSync(fileNameTmp)
1044+
} catch {
1045+
// already removed if this function is called twice simultaneously
1046+
}
10431047
}
10441048
}
10451049
// for cjs, we can register a custom loader via `_require.extensions`

0 commit comments

Comments
 (0)
Please sign in to comment.