reactjsnext.jstailwind-cssturborepo

Error: EMFILE: Too many open files Tailwind+ Turborepo + Next error


So I've ran into this error for quite a while now not being able to fix it.

At work, we have a monrepo under development and there's a ui library inside packages in it.

I built a file manager using that ui library in Vite first then because of some build issues I switched to Next.js but when I try to include tailwind, this is the error I see.

Further research and turns out in the tailwind config when the content property has the regex of files of all packages in Turborepo this error occurs.

Any solution to this please? Been dealing with this for

days now...

enter image description here


Solution

  • So I found out this is an issue with Windows. So if someone comes across this, make sure to install and use WSL. That will run the Next.js app in a Linux environment and that will solve the problem.

    I resisted from WSL a lot but it is indeed useful.