Skip to main content

If you are getting the too many open files error with MacOS it could be VSCode trying to too many open files (or by default opening more than 10240 files).

You can confirm that with the following: lsof | awk ‘{ print $2 “ “ $1; }’ | sort -rn | uniq -c | sort -rn | head -20

So, what can you do about it? If the files are not important, say it is your output folder, then you can use VSCode settings to exclude them. In the example below, I configure VSCode to ignore build folders. I would encourage this as a workspace setting, so everyone in the team gets it.

// Configure glob patterns for excluding files and folders. "files.exclude": { "**/build": true },

“files.watcherExclude”: { “**/build”: true },

“search.exclude”: { “**/build”: true },