vitest-dev / vscode

VS Code extension for Vitest
https://vitest.dev/vscode
MIT License
736 stars 83 forks source link

Vitest crash when editing imported file #369

Closed VictorCarrDev closed 3 months ago

VictorCarrDev commented 3 months ago

Describe the bug

Whenever i update a file that is being imported in any test it will crash automatically

Reproduction

Editing a file that is being imported will make it crash

Further info: i am using Node.js v18.16.1, Svelte kit and have auto save enabled in vscode

Output

Error: ENOENT: no such file or directory, open '/Users/userPathToProject/.svelte-kit/types/Users/userPathToProject/src/routes/api/user/register/$types.d.ts'
    at Object.openSync (node:fs:601:3)
    at Object.writeFileSync (node:fs:2249:35)
    at update_types (file:///Users/userPathToProject/node_modules/@sveltejs/kit/src/core/sync/write_types/index.js:349:5)
    at write_types (file:///Users/userPathToProject/node_modules/@sveltejs/kit/src/core/sync/write_types/index.js:150:2)
    at Module.update (file:///Users/userPathToProject/node_modules/@sveltejs/kit/src/core/sync/sync.js:46:8)
    at file:///Users/userPathToProject/node_modules/@sveltejs/kit/src/exports/vite/dev/index.js:301:8
    at FSWatcher.<anonymous> (file:///userPathToProject/node_modules/@sveltejs/kit/src/exports/vite/dev/index.js:275:5)
    at FSWatcher.emit (node:events:525:35)
    at FSWatcher.emitWithAll (file:///Users/userPathToProject/node_modules/vitest/node_modules/vite/dist/node/chunks/dep-jDlpJiMN.js:45679:8)
    at FSWatcher._emit (file:///Users/userPathToProject/node_modules/vitest/node_modules/vite/dist/node/chunks/dep-jDlpJiMN.js:45771:8) {
  errno: -2,
  syscall: 'open',
  code: 'ENOENT',
  path: '/Users/userPathToProject/.svelte-kit/types/Users/userPathToProject/src/routes/api/user/register/$types.d.ts'
}

Node.js v18.16.1

(I replaced the the path of the project (with my user) to userPathToProject. but the error is the same)

Version

v0.8.6

Validations

github-actions[bot] commented 3 months ago

Hello @VictorCarrDev. Please provide a minimal reproduction using a GitHub repository or StackBlitz (you can also use examples). Issues marked with needs reproduction will be closed if they have no activity within 3 days.