question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Bug] Too many open files with pnp linker

See original GitHub issue
  • I’d be willing to implement a fix

Describe the bug

When I run 2 webpack’s builds in parallel on the kinda large repo (it’s hard to say about size when there is nothing to compare) I’m getting system error too many open files. After switching to node-modules linker all works fine.

Error looks like this:

thread 'thread '<unnamed>' panicked at '<unnamed>failed to open /dev/urandom: Os { code: 23, kind: Other, message: "Too many open files in system" }' panicked at '', failed to open /dev/urandom: Os { code: 23, kind: Other, message: "Too many open files in system" }', src/libstd/sys/unix/rand.rssrc/libstd/sys/unix/rand.rs::9090::2424

To Reproduce

It’s hard to make a repro because I’m facing it with my private company project. But maybe you have some thought how to debug it or reasons why it happens.

Environment if relevant (please complete the following information):

  • OS: MacOS Catalina 10.15.6 Beta (19G46c)
  • Node 14.0.0
  • Yarn version 2.1.1
  • Webpack 4

Additional context

Also I’m getting a lot of error about peer dependencies, but not sure that it’s related:

(node:2546) [MODULE_NOT_FOUND] Error: react-dev-utils tried to access @babel/core, but it isn't declared in its dependencies; this makes the require call ambiguous and unsound.

There is the workaround for this behavior but I feel weird about it because it’s not really good DX especially in large teams https://medium.com/mindful-technology/too-many-open-files-limit-ulimit-on-mac-os-x-add0f1bfddde

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:9 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
merceyzcommented, Aug 17, 2020

There is also https://github.com/webpack/watchpack/issues/142 which looks into the same issue

0reactions
merceyzcommented, Oct 17, 2020

Closing as this seems to be fixed in webpack, if not let us know and we can reopen

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Fix the 'Too Many Open Files' Error in Linux?
It means that a process has opened too many files (file descriptors) and cannot open new ones. On Linux, the “max open file...
Read more >
24723 – Linker fails with "too many open files" - sourceware.org
When trying to link a large program, the linker fails with "Too many open files". This occurs with binutils 2.32, so the previous...
Read more >
Configuration options | Yarn - Package Manager
List of all the configuration option for Yarn (yarnrc files)
Read more >
Fixing the “Too many open files” Error in Linux - Baeldung
When working with Linux servers, we may encounter the “Too many open files” error. In this article, we'll go over what this error...
Read more >
Error LNK1104: cannot open file 'DFOR.lib' Visual Studio
In the simple case your code is directly calling a function implemented in DFOR.LIB which the linker is trying to resolve. The linker's...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found