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.

[Apple M1] Don't compile on IOS metro-hermes-compiler too many open files

See original GitHub issue

Bug Description

  • Hermes version: 0.7.2
  • React Native version: 0.64.0
  • OS version: macOS 11.2.3
  • Platform: arm64 (Apple M1)

Steps To Reproduce

  1. Update existing project from 0.63.4 to 0.64.0
  2. Compile with Xcode

The Expected Behavior

Pre-version compiles fine

Error Message


Showing All Messages
+ PACKAGER_SOURCEMAP_FILE=

+ [[ '' == true ]]

+ /Users/alexander/Code/Sputnik/sputnik-app/node_modules/@sentry/cli/sentry-cli /Users/alexander/Code/Sputnik/sputnik-app/node_modules/react-native/cli.js bundle --entry-file index.js --platform ios --dev false --reset-cache --bundle-output /Users/alexander/Library/Developer/Xcode/DerivedData/SputnikApp-fjypaeaptflxsubdwkhkfnnxdzqv/Build/Products/Release-iphonesimulator/main.jsbundle --assets-dest $'/Users/alexander/Library/Developer/Xcode/DerivedData/SputnikApp-fjypaeaptflxsubdwkhkfnnxdzqv/Build/Products/Release-iphonesimulator/\320\241\320\277\321\203\321\202\320\275\320\270\320\272.app' --sourcemap-output /Users/alexander/Library/Developer/Xcode/DerivedData/SputnikApp-fjypaeaptflxsubdwkhkfnnxdzqv/Build/Intermediates.noindex/SputnikApp.build/Release-iphonesimulator/SputnikApp.build/DerivedSources/main.jsbundle.map

                    Welcome to Metro!

              Fast - Scalable - Integrated

/Users/alexander/Code/Sputnik/sputnik-app/node_modules/metro-hermes-compiler/src/emhermesc.js:81
          throw ex;
          ^

Error: EMFILE: too many open files, watch
    at FSEvent.FSWatcher._handle.onchange (node:internal/fs/watchers:204:21)
Emitted 'error' event on NodeWatcher instance at:
    at NodeWatcher.checkedEmitError (/Users/alexander/Code/Sputnik/sputnik-app/node_modules/sane/src/node_watcher.js:143:12)
    at FSWatcher.emit (node:events:369:20)
    at FSEvent.FSWatcher._handle.onchange (node:internal/fs/watchers:210:12) {
  errno: -24,
  syscall: 'watch',
  code: 'EMFILE',
  filename: null
}
the transform cache was reset.
Command PhaseScriptExecution failed with a nonzero exit code

Additional Info

Newly created React Native project is being compiled successfully. The issue only with a existing project.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:25
  • Comments:12 (1 by maintainers)

github_iconTop GitHub Comments

26reactions
JonnyBurgercommented, May 20, 2021

fsevents is the module that causes it to break. Upgrade fsevents to fix it:

// yarn.lock
fsevents@^2.1.2:
-  version "2.1.3"
-  resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.1.3.tgz#fb738703ae8d2f9fe900c33836ddebee8b97f23e"
-  integrity sha512-Auw9a4AxqWpa9GUfj370BMPzzyncfBABW8Mab7BGWBYDj4Isgq+cDKtx0i6u9jcX9pQDnswsaaOTgTmA5pEjuQ==
+  version "2.3.2"
+  resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.2.tgz#8a526f78b8fdf4623b709e0b975c52c24c02fd1a"
+  integrity sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==
14reactions
owinter86commented, May 17, 2021

try deleting the yarn.lock file and peforming yarn install

Read more comments on GitHub >

github_iconTop Results From Across the Web

Too many open files error on Mac OS: ulim… - Apple Community
A simple fix for the "too many files open" limitation of Mac OS is to use the "ulimit - n" command. Curiously, the...
Read more >
XCode: Build failed with error "EMFILE: too many open files ...
This error is because of a bug in module fsevents for mac m1 silicon. See the thread: https://github.com/facebook/metro/issues/668.
Read more >
“Too many open files” When Compiling on macOS - JWillikers
First, check the existing soft and hard limits for the maximum number of open files. ➜ launchctl limit maxfiles maxfiles 256 unlimited. In...
Read more >
Is there a fix for the "Too many open files in system" error on ...
12 Answers 12 · 1. 256? It's 2560 file descriptors for me and I've never changed it. The limit is 266 processes (c.f....
Read more >
node:internal/fs/watchers:252 throw error; - You.com
Error: ENOSPC: System limit for number of file watchers reached, . ... M1] Don't compile on IOS metro-hermes-compiler too many open files#668.
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