`EMFILE: too many open files` during build
Anyone happen to know anything about the
EMFILE: too many open files error with workers builds? I see a bunch of people posting about it in the past, but none of them have any replies.
Basically, I'm trying out workers builds for a full-stack site built with SvelteKit, hoping to eventually move my Pages projects to workers since Pages is basically abandoned at this point, but I'm getting this error. I've retried many times and have gotten that error every time. Build works fine locally.
Any help with this would be greatly appreciated.9 Replies
I just started getting this after never seeing it in months of builds, so I'd love to know the answer here too..
Reported this to the Builds team and they're working on it :)
thank you 🙂
Same here. Following this and the GH issue.
I'm also having the same issue
me too, specficailly seems to get thrown when compiling the Lucide node modules
Lucide-React causes issues for me too. With Vite?
Okay, I found a (sucky-but-works) solution:
1. Use
bun build to do the JS bundling into an intermediate build folder (ie: ./dist)
2. Copy an empty index.html file to the ./dist folder, making it point to the ./main.js built by bun.
3. Use vite build to package that with the CSS into one HTML in the distribution folder (ie: ./public).
I had to change a few paths, make my index.html file point to my main.js` file, and have all the CSS imports in the index.html, but it works locally, and it deploys properly for nowdirectly importing each individual icon instead of destructing multiple icons in the same import fixed the issue for me
It's not great, but it works
The GH issue mentioned it, but I cannot require like that in React
Someone in the GH issue said it was resolved. I checked and it does work again on my side.