lucide: Vercel/Next.js/React/Node 'too many open files' error
Prerequisites
- Version:
lucide-react@0.262.0
,next@13.4.10
- Are you running from source/main: Next.js’s Webpack
- Are you using a released build: Yes, https://github.com/lucide-icons/lucide/tree/v0.262.0
- Operating system: Node.js 18.x
- Bits:
Step to reproduce
Installed using yarn
, following https://github.com/lucide-icons/lucide/tree/main/packages/lucide-react#lucide-react.
Error happens when all icons are imported as React Component individually, and also when all icons are imported using Next.js dynamic import.
Actual behavior
Any message or error
Error message via Vercel logs:
[Error: EMFILE: too many open files, open '/var/task/node_modules/lucide-react/dist/esm/icons/share.mjs'] {
errno: -24,
code: 'EMFILE',
syscall: 'open',
path: '/var/task/node_modules/lucide-react/dist/esm/icons/share.mjs'
}
[Error: EMFILE: too many open files, open '/var/task/node_modules/lucide-react/dist/esm/icons/share.mjs'] {
errno: -24,
code: 'EMFILE',
syscall: 'open',
path: '/var/task/node_modules/lucide-react/dist/esm/icons/share.mjs',
page: '/robots.txt'
}
RequestId: ace94785-66ac-47ca-81d7-ff1ab00793bc Error: Runtime exited without providing a reason
Runtime.ExitError
Client side, nothing to go on:
Resources
Update; perhaps related?
About this issue
- Original URL
- State: closed
- Created a year ago
- Reactions: 4
- Comments: 18 (2 by maintainers)
Confirmed downgrading to
0.261.0
fixed the issues for me as well.Solved by adding the following to
next.config.js
:But there are some problems - could you guys cooperate to get this fixed on both sides? 😃 Would be cool.
There is honestly no way that this option would ever work. The files are in some deeply nested folder which are not specified in the package.json from the lucide-react package
Good news. NextJS PR just got merged to canary.
It works on Vercel, v0.261.0, no configuration added. But, like I mentioned in one comment, that can be just me being below the limit and the problem still being there, as locally I still compile 1000+ more components when the app is run.
Related/duplicate issue see #1457. See my comment in #1457 (possible todo with
.mjs
modules), for the time being try version: 0.261.0This is not working, checking locally, and getting:
I am on version 0.263.1