[Yarn2/PnP] Recompilation fails: "Error: Can't open file: No file descriptors available"
See original GitHub issueI’m trying to migrate our project to Yarn2 using its new PnP resolution mechanism. In watch mode, using webpack-dev-server, whenever I change a file, something screws up. The initial compilation works fine.
/Users/nkalinov/dev/simonapp/.pnp.js:39844
throw firstError;
^
Error: Can't open file: No file descriptors available
Require stack:
- /Users/nkalinov/dev/simonapp/.yarn/cache/watchpack-npm-1.6.0-2e77885616-1.zip/node_modules/watchpack/lib/watcherManager.js
- /Users/nkalinov/dev/simonapp/.yarn/cache/watchpack-npm-1.6.0-2e77885616-1.zip/node_modules/watchpack/lib/watchpack.js
- /Users/nkalinov/dev/simonapp/.yarn/cache/webpack-npm-4.41.5-ec6f53e9d3-1.zip/node_modules/webpack/lib/node/NodeWatchFileSystem.js
- /Users/nkalinov/dev/simonapp/.yarn/cache/webpack-npm-4.41.5-ec6f53e9d3-1.zip/node_modules/webpack/lib/node/NodeEnvironmentPlugin.js
- /Users/nkalinov/dev/simonapp/.yarn/cache/webpack-npm-4.41.5-ec6f53e9d3-1.zip/node_modules/webpack/lib/webpack.js
- /Users/nkalinov/dev/simonapp/.yarn/$$virtual/webpack-dev-server-virtual-d46dc61805/0/cache/webpack-dev-server-npm-3.10.1-34b49b6a2b-1.zip/node_modules/webpack-dev-server/bin/webpack-dev-server.js
at new ZipFS (/Users/nkalinov/dev/simonapp/.pnp.js:28860:15)
at ZipOpenFS.getZipSync (/Users/nkalinov/dev/simonapp/.pnp.js:33358:52)
at ZipOpenFS.makeCallSync (/Users/nkalinov/dev/simonapp/.pnp.js:33257:17)
at ZipOpenFS.existsSync (/Users/nkalinov/dev/simonapp/.pnp.js:32755:17)
at VirtualFS.existsSync (/Users/nkalinov/dev/simonapp/.pnp.js:27279:24)
at /Users/nkalinov/dev/simonapp/.pnp.js:40152:28
at Array.find (<anonymous>)
at applyNodeExtensionResolution (/Users/nkalinov/dev/simonapp/.pnp.js:40150:10)
at resolveUnqualified (/Users/nkalinov/dev/simonapp/.pnp.js:40504:27)
at resolveRequest (/Users/nkalinov/dev/simonapp/.pnp.js:40536:14)
at Object.resolveRequest (/Users/nkalinov/dev/simonapp/.pnp.js:40598:26)
at Function.module_1.Module._resolveFilename (/Users/nkalinov/dev/simonapp/.pnp.js:39827:34)
at Function.module_1.Module._load (/Users/nkalinov/dev/simonapp/.pnp.js:39712:40)
at Module.require (internal/modules/cjs/loader.js:848:19)
at require (internal/modules/cjs/helpers.js:74:18)
at WatcherManager.getDirectoryWatcher (/Users/nkalinov/dev/simonapp/.yarn/cache/watchpack-npm-1.6.0-2e77885616-1.zip/node_modules/watchpack/lib/watcherManager.js:14:25) {
requireStack: [
'/Users/nkalinov/dev/simonapp/.yarn/cache/watchpack-npm-1.6.0-2e77885616-1.zip/node_modules/watchpack/lib/watcherManager.js',
'/Users/nkalinov/dev/simonapp/.yarn/cache/watchpack-npm-1.6.0-2e77885616-1.zip/node_modules/watchpack/lib/watchpack.js',
'/Users/nkalinov/dev/simonapp/.yarn/cache/webpack-npm-4.41.5-ec6f53e9d3-1.zip/node_modules/webpack/lib/node/NodeWatchFileSystem.js',
'/Users/nkalinov/dev/simonapp/.yarn/cache/webpack-npm-4.41.5-ec6f53e9d3-1.zip/node_modules/webpack/lib/node/NodeEnvironmentPlugin.js',
'/Users/nkalinov/dev/simonapp/.yarn/cache/webpack-npm-4.41.5-ec6f53e9d3-1.zip/node_modules/webpack/lib/webpack.js',
'/Users/nkalinov/dev/simonapp/.yarn/$$virtual/webpack-dev-server-virtual-d46dc61805/0/cache/webpack-dev-server-npm-3.10.1-34b49b6a2b-1.zip/node_modules/webpack-dev-server/bin/webpack-dev-server.js'
]
}
OS: OSX Node version: tried both v12.14.1 and latest v10 Yarn version: 2.0.0-rc.28 Related Yarn issue: https://github.com/yarnpkg/berry/issues/849
Issue Analytics
- State:
- Created 4 years ago
- Reactions:2
- Comments:39 (14 by maintainers)
Top Results From Across the Web
Error Codes | Yarn - Package Manager
This error means that this process failed and Yarn cannot successfully figure out which version of the package should be added to your...
Read more >Compatibililty with Yarn PnP (Plug and Play) feature - YouTrack
The main issue for the IDE I believe is the missing node_modules folder which I believe is used to introspect modules & hydrate...
Read more >Yarn 2 and TypeScript: Adding Webpack - Medium
This extends my first article, Getting Started with Yarn 2 and TypeScript, and you can find the updated code this article is based...
Read more >Jest monorepo cannot find module
2. husky folder in the root directory with pre-commit file in it. ts-node is ... Jest can run without any config files, but...
Read more >To v5 from v4 - webpack
Consider removing optimization. · When using [hash] placeholder in webpack configuration, consider changing it to [contenthash] . · If you are using Yarn's...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

I’m able to reproduce https://github.com/webpack/watchpack/issues/142#issuecomment-675307821, i’ll make a fix to Yarn and let you know
We’re looking into that (although I’m not sure how to repro as our own app is fine 🤔)