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 Windows when build.watch is enabled #80

Open
eugenesvk opened this issue Jun 5, 2022 · 1 comment
Open

Crash on Windows when build.watch is enabled #80

eugenesvk opened this issue Jun 5, 2022 · 1 comment

Comments

@eugenesvk
Copy link

The dev vite server with the default configs from your template causes a crash on Windows 10 randomly or reliably whenever a new folder on the root drive C:\ is created.

It's similar to this closed vite issue or this one, although the culprit isn't the settings passed to chokidar in your scripts/prepare.ts script, but rather these rollup watcher options

build: {
    watch: isDev
      ? {}
      : undefined,

from vite.config.content.ts

If I comment them out, then vite dev doesn't crash when I create a folder on my C:\ drive. Not sure why the {} (which is also the default in rollup) leads to the watcher watching over the whole drive and thus causing the crash and whether this is a template config issue or an upstream bug (with vite or rollup?) or something

@tonjohn
Copy link

tonjohn commented Dec 12, 2023

This has been fixed in in Vite 5 per vitejs/vite#13234 (comment)

Unfortunately Vite does not provide instructions on how to upgrade versions so I just used npm-check-updates:

npx npm-check-updates -i --format group

I YOLO'd and upgraded all the packages. Here is what my package.json diff looks like:

package.json dependencies diff

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

2 participants