Skip to content
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

EMFILE: too many open files, open '...' during generate process #2320

Closed
manniL opened this issue Sep 18, 2023 · 2 comments · Fixed by #2321
Closed

EMFILE: too many open files, open '...' during generate process #2320

manniL opened this issue Sep 18, 2023 · 2 comments · Fixed by #2321
Assignees
Labels
bug Something isn't working

Comments

@manniL
Copy link
Member

manniL commented Sep 18, 2023

Environment


  • Operating System: Linux
  • Node Version: v18.14.2
  • Nuxt Version: 3.7.1
  • CLI Version: 3.7.3
  • Nitro Version: 2.6.2
  • Package Manager: pnpm@7.18.0
  • Builder: -
  • User Config: runtimeConfig, app, nitro, modules, content, tailwindcss
  • Runtime Modules: @nuxtjs/tailwindcss@6.8.0, @vueuse/nuxt@10.4.1, nuxt-icon@0.5.0, @nuxt/content@2.8.2
  • Build Modules: -

Reproduction

https://github.com/manniL/nuxt-content-2320

Describe the bug

While working on my website, I noticed a crucial issue: In case there is a site that accesses a lot of files at once (in my case 50) that are also generated via nuxt content, you'll receive an EMFILE: too many open files error. Alternatively, a ERROR [nuxt] [request error] [unhandled] [500] content.startsWith is not a function masking the actual error.

This can be solved by chunking the keys and creating a pseudo-queue, instead of using Promise.all here

const contents = await Promise.all(keys.map(key => getContent(event, key)))

Will submit a PR shortly.

Additional context

No response

Logs

No response

@manniL manniL self-assigned this Sep 18, 2023
@manniL manniL added the bug Something isn't working label Sep 18, 2023
@manniL manniL mentioned this issue Sep 18, 2023
7 tasks
@ManasMadrecha
Copy link

Will the linked PR also solve #2354?

@manniL
Copy link
Member Author

manniL commented Oct 8, 2023

@ManasMadrecha it should be already live but I'm not sure if it will help with exactly this problem. Give it a try though!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants