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

core branch: EMFILE too many open files error on Mac build #283

Closed
robbear opened this issue Dec 9, 2021 · 1 comment
Closed

core branch: EMFILE too many open files error on Mac build #283

robbear opened this issue Dec 9, 2021 · 1 comment
Labels
enhancement New feature or request

Comments

@robbear
Copy link
Contributor

robbear commented Dec 9, 2021

On the core branch, if you build example/docs with sufficient content (I copied about.en.md to about1.en.md, about2.en.md, ... about39.en.md), you run into UnhandledPromiseRejectionWarning errors: EMFILE: too many open files

This appears to be related to the Promise.all approach of getPageMap/getFiles in packages/nextra/src/loader.js. Making that operation synchronous (I tweaked the code with a synchronous version of getPageMap) allows the Mac build to succeed.

This open files build error seems limited to my Mac builds. My Linux/Ubuntu builds don't run into this.

I'm running macOS Big Sur version 11.6 on a 2019 MacBook Pro Intel Core i7 with 32 GB memory.

$ next build
You have i18n enabled for Nextra.
info  - Checking validity of types  
warn  - No ESLint configuration detected. Run next lint to begin setup
(node:5683) UnhandledPromiseRejectionWarning: Error: EMFILE: too many open files, open '/Users/robbear/dev/robbear/nextra/examples/docs/pages/nextra/about2.en.md'
(Use `node --trace-warnings ...` to show where the warning was created)
(node:5683) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:5683) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
(node:5683) UnhandledPromiseRejectionWarning: Error: EMFILE: too many open files, open '/Users/robbear/dev/robbear/nextra/examples/docs/pages/blog/hello-world.en.md'
(node:5683) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2)
@shuding shuding added the enhancement New feature or request label Dec 9, 2021
shuding added a commit that referenced this issue Jan 14, 2022
Fix #283: Use util.promisify to wrap graceful-fs methods in nextra loader.js
@dimaMachina
Copy link
Collaborator

Closing as completed #318

tatukoivisto pushed a commit to tatukoivisto/nextra that referenced this issue Aug 20, 2023
Fix shuding#283: Use util.promisify to wrap graceful-fs methods in nextra loader.js
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants