Skip to content

Commit

Permalink
Fix houdini-svelte crashing the vscode svelte LSP (#1293)
Browse files Browse the repository at this point in the history
  • Loading branch information
SeppahBaws committed Apr 13, 2024
1 parent 71ec485 commit 8409c70
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/afraid-pillows-worry.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'houdini-svelte': patch
---

Fix houdini-svelte occasionally causing the Svelte LSP to crash
6 changes: 4 additions & 2 deletions packages/houdini-svelte/src/plugin/fsPatch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,11 @@ filesystem.readFileSync = function (fp, options) {
}

// @ts-ignore
filesystem.statSync = function (filepath: string, options: Parameters<filesystem.StatSyncFn>[1]) {
filesystem.statSync = function (fp: PathLike, options: Parameters<filesystem.StatSyncFn>[1]) {
let filepath = fp.toString()

if (!filepath.includes('routes') || !path.basename(filepath).startsWith('+')) {
return _statSync(filepath, options as any)
return _statSync(fp, options as any)
}

try {
Expand Down

0 comments on commit 8409c70

Please sign in to comment.