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

Plugin causes intermittent chokidar error in Vite watch mode on Windows #269

Open
horsenit opened this issue Dec 17, 2021 · 1 comment
Open
Labels
bug Something isn't working

Comments

@horsenit
Copy link

Describe the bug
Occasionally, on Windows, while using this plugin Vite can exit with an error from chokidar (EBUSY, usually with a system file like DumpStack.log, hiberfil.sys, pagefile.sys, or swapfile.sys, so it likely has to be on the system drive)

Minimal Reproductions
Using your WebExtension Vite Starter Template, https://github.com/antfu/vitesse-webext, pnpm run dev this crash will happen intermittently, but you can induce it by creating and deleting a new folder in the root of the drive (C:\ I guess)

Versions

  • vite-plugin-windicss: 1.5.4
  • vite: 2.6.2

Additonal Context
This is because of packages/shared/virtual-module.ts, specifically MODULE_ID_VIRTUAL_PREFIX, this ends up adding a path like /@windicss/windi.css to rollup's FS watcher, which I guess makes chokidar start watching the root directory. Adding a \0 or ~ to the start of that variable resolves the issue, maybe the regex below it as well.

@horsenit horsenit added the bug Something isn't working label Dec 17, 2021
@chartinger
Copy link

Took me a while to find out this plugin was the cause of my problem.
Used the same Starter Template and - surprise - same error :)

Adding your prefixes to the paths "solved" the problem. 👍 Would be nice to have it fixed permanently. Does the fix work on other platforms? (seems there was a related problem in underfin/vite-plugin-vue2#24)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants