Build error: too many open files
I am building a Next.js project on Cloudflare Workers, but I always get this error, could anyone help me?
22:31:34.611 ... finished build of 7 collections and 106 documents in 1144ms
22:31:34.625 ⚠ No build cache found. Please configure build caching for faster rebuilds. Read more: https://nextjs.org/docs/messages/no-cache
22:31:34.630 Attention: Next.js now collects completely anonymous telemetry regarding usage.
22:31:34.630 This information is used to shape Next.js' roadmap and prioritize features.
22:31:34.631 You can learn more, including how to opt-out if you'd not like to participate in this anonymous program, by visiting the following URL:
22:31:34.631 https://nextjs.org/telemetry
22:31:34.631
22:31:34.763 ▲ Next.js 15.2.1
22:31:34.764
22:31:34.812 Creating an optimized production build ...
22:33:45.402 ✓ Compiled successfully
22:33:45.412 Linting and checking validity of types ...
22:34:23.888 Collecting page data ...
22:34:28.132 [Error: EMFILE: too many open files, open '/opt/buildhome/repo/.next/server/chunks/5131.js'] {
22:34:28.133 errno: -24,
22:34:28.134 code: 'EMFILE',
22:34:28.138 syscall: 'open',
22:34:28.138 path: '/opt/buildhome/repo/.next/server/chunks/5131.js'
22:34:28.138 }
22:34:28.270 ELIFECYCLE Command failed with exit code 1.
22:34:28.502 Failed: error occurred while running build command
22:31:34.611 ... finished build of 7 collections and 106 documents in 1144ms
22:31:34.625 ⚠ No build cache found. Please configure build caching for faster rebuilds. Read more: https://nextjs.org/docs/messages/no-cache
22:31:34.630 Attention: Next.js now collects completely anonymous telemetry regarding usage.
22:31:34.630 This information is used to shape Next.js' roadmap and prioritize features.
22:31:34.631 You can learn more, including how to opt-out if you'd not like to participate in this anonymous program, by visiting the following URL:
22:31:34.631 https://nextjs.org/telemetry
22:31:34.631
22:31:34.763 ▲ Next.js 15.2.1
22:31:34.764
22:31:34.812 Creating an optimized production build ...
22:33:45.402 ✓ Compiled successfully
22:33:45.412 Linting and checking validity of types ...
22:34:23.888 Collecting page data ...
22:34:28.132 [Error: EMFILE: too many open files, open '/opt/buildhome/repo/.next/server/chunks/5131.js'] {
22:34:28.133 errno: -24,
22:34:28.134 code: 'EMFILE',
22:34:28.138 syscall: 'open',
22:34:28.138 path: '/opt/buildhome/repo/.next/server/chunks/5131.js'
22:34:28.138 }
22:34:28.270 ELIFECYCLE Command failed with exit code 1.
22:34:28.502 Failed: error occurred while running build command
0 Replies