Skip to content

Commit 8f4fe71

Browse files
authored
fix(svelte-check): ignore Unix domain sockets in file watcher (#2931)
svelte-check crashes when encountering Unix domain sockets (e.g., .sock files) in watch mode because chokidar cannot watch these special files. This adds a check to ignore sockets using stats.isSocket(), preventing the crash and allowing svelte-check to continue operating normally. chore: add changeset for unix socket fix
1 parent 0b8af82 commit 8f4fe71

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

.changeset/fix-unix-sockets.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'svelte-check': patch
3+
---
4+
5+
fix: ignore Unix domain sockets in file watcher to prevent crashes

packages/svelte-check/src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ class DiagnosticsWatcher {
9494
if (
9595
path.includes('node_modules') ||
9696
path.includes('.git') ||
97+
stats?.isSocket() ||
9798
(stats?.isFile() &&
9899
(!FILE_ENDING_REGEX.test(path) || VITE_CONFIG_REGEX.test(path)))
99100
) {

0 commit comments

Comments
 (0)