lucide
lucide copied to clipboard
Release 0.471.0 causes Vercel serverless function to crash with `EMFILE: too many open files`
Package
- [ ] lucide
- [ ] lucide-angular
- [ ] lucide-flutter
- [ ] lucide-preact
- [x] lucide-react
- [ ] lucide-react-native
- [ ] lucide-solid
- [ ] lucide-svelte
- [ ] lucide-vue
- [ ] lucide-vue-next
- [ ] Figma plugin
- [ ] source/main
- [ ] other/not relevant
Version
0.474.0
Can you reproduce this in the latest version?
- [x] Yes
- [ ] No
Browser
- [x] Chrome/Chromium
- [x] Firefox
- [x] Safari
- [x] Edge
- [ ] iOS Safari
- [ ] Opera
- [ ] Other/not relevant
Operating system
- [ ] Windows
- [ ] Linux
- [x] macOS
- [ ] ChromeOS
- [ ] iOS
- [ ] Android
- [ ] Other/not relevant
Description
Related issues:
https://github.com/lucide-icons/lucide/issues/2739 https://github.com/lucide-icons/lucide/issues/2734 https://github.com/lucide-icons/lucide/issues/2730
Don't mean to add unnecessary duplicates to your plate @ericfennis 😅 but ultimately decided to open this issue as the others are marked as closed, and this will hopefully provide some extra context.
It appears the change made in 0.471.0 has broken something in my deployment.
My app uses Remix 2.15.3 and is deployed via Vercel Serverless functions. I am only importing icons as recommended in the docs:
import { Plus } from "lucide-react";
lucide-react 0.470.0
works as expected, and 0.471.0
causes the serverless Vercel function to crash with a handful of errors that look like this:
Error: EMFILE: too many open files, open '/var/task/node_modules/lucide-react/dist/esm/icons/file-lock.js'
at async open (node:internal/fs/promises:638:25)
at async readFile (node:internal/fs/promises:1238:14)
at async getSource (node:internal/modules/esm/load:44:14)
at async defaultLoad (node:internal/modules/esm/load:116:34)
at async ModuleLoader.loadAndTranslate (node:internal/modules/esm/loader:479:32) {
errno: -24,
code: 'EMFILE',
syscall: 'open',
path: '/var/task/node_modules/lucide-react/dist/esm/icons/file-lock.js'
}
Node.js process exited with exit status: 1. The logs above can help with debugging the issue.
NOTE: the error above references a specific icon, but the issue isn't with any specific icon. It appears that all of the icons are being bundled/opened?
In the release notes of the problematic 0.471.0
, it mentions a potential breaking change that seems like the most likely culprit:
Possible Breaking changes We have switched to the "exports" property in package.json. This can cause issues if you have directly imported scripts from the package. Please open an issue if we need to refine this export map.
Other relevant specs:
Package manager: Bun 1.1.43
Steps to reproduce
- Install
lucide-react
0.471.0
or greater. - Import an icon using named exports
import { X } from "lucide-react";
- Deploy to Vercel
Checklist
- [x] I have searched if someone has submitted a similar issue before and there weren't any. (Please make sure to also search closed issues, as this issue might already have been resolved.)