Next.js Discord

Discord Forum

NextJS upgrade causes too many open files error in gradle build

Unanswered
fewd_123 posted this in #help-forum
Open in Discord
I tried upgrading from NextJS 13 to 14 and everything is fine in local but when I try gradle build in server, it causes too many open files error.
Error: EMFILE: too many open files, open '/work/.next/server/pages/api/create-account/tests/index.test.js'] {
errno: -24,
code: 'EMFILE',

19 Replies

Trying now. BUt meanwhile, what does this do
@fewd_123 Trying now. BUt meanwhile, what does this do
because next will spin up as many thread as it can when building
and may cause too many open files
if it works, you could adjust the cpus value. I think with cpus 1 the build will become a little bit slow?
I am trying now. Will keep you posted
That did not help. Still broke gradle build with the same error - too many open files
I do and I deleted the one in the error last time and a new one came up. It just brings up random files for each build
it passed
@fewd_123 it passed
you hosting in a vps?
yes
@fewd_123 yes
linux?
yes
@fewd_123 yes
ok I think there is two way to fix it
1. increase the file limit
2. build a standalone output and upload the folder to server
BUt why did this error come up only with NextJS upgrade? it does not happen when I downgrade NextJS to 13
@fewd_123 BUt why did this error come up only with NextJS upgrade? it does not happen when I downgrade NextJS to 13
well I'm not sure what they added in next 14 and causing this issue