Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

crash on watcher ignore check #461

Open
2 tasks done
helpsl opened this issue Feb 25, 2025 · 0 comments
Open
2 tasks done

crash on watcher ignore check #461

helpsl opened this issue Feb 25, 2025 · 0 comments

Comments

@helpsl
Copy link

helpsl commented Feb 25, 2025

Describe the bug

Getting a crash when a file / folder change occurs but is deleted before executing validating the path

node:internal/event_target:1101 process.nextTick(() => { throw err; }); ^ Error: ENOENT: no such file or directory, stat 'D:\Projects\web\.vs\web\FileContentIndex\merges' at statSync (node:fs:1740:25) at file:///D:/Projects/web/node_modules/vite-plugin-checker/dist/glob.js:25:68 at matchPatterns (file:///D:/Projects/web/node_modules/vite-plugin-checker/node_modules/chokidar/esm/index.js:63:13)

Reproduction

trigger a file/folder validation check but delete that item before plugin finishes executing check

as it's dependant on execution time you might be able to add a break point in to your code to delay the check while you delete the file/folder in question

Expected behavior

path validation doesn't cause the plugin to crash when it fails to validate a non-existent path

System Info

System:
    OS: Windows 11 10.0.26100
    CPU: (12) x64 AMD Ryzen 5 7600 6-Core Processor
    Memory: 18.15 GB / 31.15 GB
Binaries:
    Node: 22.14.0 - C:\Program Files\nodejs\node.EXE
    npm: 10.9.2 - C:\Program Files\nodejs\npm.CMD
Browsers: {}
npmPackages:
    vite-plugin-checker: ^0.9.0 => 0.9.0

Additional context

it looks as if using statSync in glob.js will cause a throw if the path which you are checking no longer exists at the time of verification.
adding throwIfNoEntry as a secondary parameter to the function and updating the isDirectory check call to only be called if the returned value is defined seems to fix the issue.

Validations

  • Read the docs.
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant