-
-
Notifications
You must be signed in to change notification settings - Fork 7.7k
Open
Labels
Description
Describe the bug
Linux has a default limit of file watchers (around 10K). If you happen to have 1M images in working directory, Vite server will crash.
Workaround is to add folders to server.watch.ignore. However, the error messages should be more instructive.
Reproduction
https://github.com/guoyunhe/vite-file-watcher-limit
Steps to reproduce
git clone git@github.com:guoyunhe/vite-file-watcher-limit.git
cd vite-file-watcher-limit
pnpm i
pnpm dev
Wait for 10s and it will probably crash
System Info
System:
OS: Linux 6.18 openSUSE Tumbleweed 20260106
CPU: (12) x64 AMD Ryzen 5 5600X 6-Core Processor
Memory: 19.64 GB / 31.27 GB
Container: Yes
Shell: 5.3.9 - /bin/bash
Binaries:
Node: 22.21.1 - /usr/bin/node
Yarn: 1.22.22 - /usr/bin/yarn
npm: 10.9.4 - /usr/bin/npm
pnpm: 10.20.0 - /home/guo/.local/share/pnpm/pnpm
Deno: 2.4.5 - /usr/bin/deno
Browsers:
Chromium: 143.0.7499.169
Firefox: 146.0.1
Firefox Developer Edition: 146.0.1
npmPackages:
@vitejs/plugin-react: ^5.1.1 => 5.1.2
vite: ^7.2.4 => 7.3.1Used Package Manager
pnpm
Logs
Error: ENOSPC: System limit for number of file watchers reached, watch '/home/guo/git/vite-file-watcher-limit/storage/file-319871.jpg'
Validations
- Follow our Code of Conduct
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- Make sure this is a Vite issue and not a framework-specific issue. For example, if it's a Vue SFC related bug, it should likely be reported to vuejs/core instead.
- Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.
- The provided reproduction is a minimal reproducible example of the bug.