-
-
Notifications
You must be signed in to change notification settings - Fork 60
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error: EMFILE: too many open files #45
Comments
@lionelrudaz How old is the project and what is the package json look like? What are you using in the pipe to build the project? The emfile error sometimes come from a limit at the Node server. So that could be an problem. |
Having the same problem.
|
@manskron, could you also give some more informations about your project pls. How old is the project and what is the package json look like? What are you using in the pipe to build the project? |
@TobiasLueger It's a Next.js v13.2.4 project running on Node v18. |
I am only getting this error when deploying on Vercel. Locally it seems to work just fine. |
I am having the same issue, I am trying to use the modularizeImports feature from next, but then I get the following error: Using the latest version: 2.0.6 |
I managed to solve this problem using the modularizeImports feature from next like mentioned above, but the path for the icons is either incorrect in the "exports": {
".": {
"import": "./dist/index.es.js"
},
"./*": {
"import": "./dist/icons/*.es.js"
}
} But it works with While TypeScript says the path should be Solution is to add the following property in your next config file: modularizeImports: {
"@phosphor-icons/react": {
transform: "@phosphor-icons/react/{{member}}",
},
}, And then you can use the imports normally and next will take care to modularize the imports for you. |
Hey gang. The paths for the icons were correct, but the typings did not account for the aliasing we do in the
I recommend using the full /dist/icons/Foo paths all the same, if you plan on using modular imports. I would love to hear if this fixes things for you. |
Updated the lib version and my next config to: modularizeImports: {
"@phosphor-icons/react": {
transform: "@phosphor-icons/react/dist/icons/{{member}}",
},
}, And it does indeed work now with this path, thank you! |
Same here. I'm also deploying on Vercel. Sorry for the delay in my answer. @rektdeckard, does that mean we must have this configuration if we plan to use the library on a Nextjs project?
Please let us know if this is a temporary workaround or something that must be documented for new developers. |
@lionelrudaz I'm really not sure, I don't use Next and I'm honestly shocked at the hoops library maintainers are now needing to jump through to make basic functionality work in it. Every other build tooling supports tree-shaking of ESM modules out of the box, and can handle this in packages with 10 or 10,000 files. Why not in Next? Could just be a Vercel thing too, IDK. |
Got you, I agree this becomes a nightmare for you. Should I open an issue at Vercel's end for that or do you plan to document the workaround? With the market shares of Vercel, this is perhaps a good thing to mention somewhere in your pages. I can help for that of course. |
@lionelrudaz you've tried the v2.0.8 without |
Just updating this Issue, I have this same error in a Next.js application, where I have version 2.0.5 of Phosphor and the error still persists, strangely, I have another application published in Vercel with the same version of the package and it does not show error. |
@bernardinorafael that's because this isn't an error originating in Phosphor, it's a Vercel CLI tool that is not designed to work with libraries with many small files. Upgrade to 2.0.8 and try modularizing the imports. |
Possibly resolved by #56. Would anyone here care to test by upgrading to v2.0.10 and attempting to deploy to Vercel? |
I've upgraded the library to 2.0.10, was using 2.0.9 before. I wonder if our friends at Vercel haven't changed something at their end, as I haven't added the modularizeImports workaround and I've been deploying with no issue for a while. Anybody in the same situation? |
I've tried 2.0.9 & 2.0.10, both still result in the same error:
Adding modularizeImports into my Should also note I am importing the icons as: It does not work when importing each one individually either. TL;DR — Vercel screwed something up? |
New error message on a different route (now errors at Sigma, not Sidebar)
Current (temporary) solution: use the legacy package via |
I'm having the same issue:
i had to switch from |
Loading the phosphor icons from |
Also having this issue on NextJs with Netlify.
@dantevicenzo bit of a noob developer here but your solution looked promising, could you kindly explain the main differences of @phospor-icons/react vs phosphor-react? I'm importing icons like this if its any help:
Thanks ahead for any help. |
Dit not work for me, can anyone help? |
It looks like Nextjs 13.5 added optimizations specifically for this problem (large component/icon libraries with many files). The |
Confirming @rektdeckard's find - we updated to NextJS 13.5.3 and the
|
It appears that in Nextjs version 13.5.5 this issue has been resolved without requiring any additional configuration. |
I can confirm that this error is still present, if you try to import more icons at once. The modularizeImports fix above is no longer working with the newest version, since the icons are now in different folders. So in order to make it work you need to change it to this:
I was also using styled-components in my code and it was still throwing errors when I tried to style the icons (icon was undefined). So I also had to import the icon this way.
But you would need to import all your icons this way, which is not rly fun. So its easier to use the experimental code and hope that it wont fail.
|
Getting this same error with a Vite + Remix app deployed to vercel. I've determined just importing a single icon causes the EMFILE errors in Vercel. I don't have access to "optimizePackageImports" since this is a remix+vite app. I don't have too much helpful to add for others - importing the icons like |
Hello community, For about two weeks now, I've been experiencing difficulties compiling my Next.js project on Windows 11. Previously, the build process ran smoothly, but now I'm encountering the following error that I can't seem to resolve: `npm run build
✓ Linting and checking validity of types I've reviewed the code changes made, but even switching to a production-ready branch where compilation previously worked fine hasn't resolved the issue. My Windows 11 operating system recently underwent an update, leading me to suspect that something during this update may have affected the compilation process. Additionally, I am using Next.js version 13.5.6 and Node.js version v22.4.1. I appreciate any suggestions or advice on how to approach this issue. Has anyone else experienced something similar after updating to Windows 11? Thank you in advance! |
Hi @rektdeckard, I have the same problem as stated in #45 (comment). I have a fairly simple remix app, deployed to vercel and every time I try to import the icons with |
@nikolailehbrink just import from the full path instead of the barrel file: import { Smiley } from "@phosphor-icons/react/dist/ssr/Smiley"; Unfortunately there is not a solution on our end. These build tools are simply not equipped for this many files. |
Ahh okay, yeah I wondered if there is a different solution, maybe for remix, but I will head over to that repo and ask. Thanks for the icons and packages! @rektdeckard |
Moving from "phosphor-react" to "@phosphor-icons/react", I've got the following issues when deploying on Vercel in a Nextjs application:
I'm still using the /pages directory, haven't moved to /app yet in my codebase.
Tried to upgrade my Node server from v16 to v18, no luck.
SidebarSimple is not even used in my code.
Looks like it's bugging when I need to check the auth state with NextAuthjs. So perhaps there's a conflict with the signIn and signOut methodes from this other library, as I can see a lot of similar errors in my logs.
Let me know if I can bring more context.
The text was updated successfully, but these errors were encountered: