Fixing OS File Watch Limit Reached Error

How to fix the 'OS file watch limit reached' error when running yarn dev by increasing the Linux inotify file watch limit
May 8, 2026

OS file watch limit reached

When running yarn run dev (or npm run dev), you may encounter the following error.
OS file watch limit reached error
sh

Cause

This error occurs when the Linux kernel's inotify file watch limit is exceeded.
Development servers like Next.js, Vite, and Webpack simultaneously watch a large number of files in your project to detect changes and perform Hot Reload.
If the default value of fs.inotify.max_user_watches is too low, the number of files to watch exceeds the limit and the error occurs.
Check current inotify watch limit
sh

Solution

You can resolve this by increasing the fs.inotify.max_user_watches value using sysctl.
First, apply it immediately to the current session.
Apply immediately (current session)
sh
Add a permanent setting to /etc/sysctl.conf to persist the change across reboots.
Persist across reboots
sh
Jooojub
System S/W engineer
Explore Tags
Series
    Recent Post
    © 2026. jooojub. All right reserved.