Well well this took me considerable time to resolve this error.
Some Errors are like that you got to dig in for much longer than you would like to. This was one of these for me. I'm sharing my solution here to make it a bit easier for other developers.
This problem seems to affect especially Linux users like myself. I can't confirm this for sure as I run only Linux- distribution.
events.js:292 throw er; // Unhandled 'error' event ^ Error: ENOSPC: System limit for number of file watchers reached, watch '/home/user_name/chat-app/public' at FSWatcher.<computed> (internal/fs/watchers.js:218:26) at Object.watch (fs.js:1525:34)
This happens when you have multiple react projects open. Try to close other projects and test again. This happens because your changes on the project are watched on the fly.
Sometimes when this error occurs I used to do
npm/yarn install to update the dependencies and start working. But this may not be handy everytime. Better go with other options.
Visual Studio Code is unable to watch for file changes in this large workspace (error ENOSPC)
This this shows on notification bar of VS Code then refer the beautiful explanation and solution of this issue through VS Code Docs i.e. Solution to issue
Watch a video by Gaurav if you prefer watching video a lot.
Have a good day 😊 !!!