FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
See original GitHub issueDo you want to request a feature or report a bug? BUG
What is the current behavior? When bundling for debug, the Metro bundler will crash with: FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory. The project contains a lot of images and JS files
If the current behavior is a bug, please provide the steps to reproduce and a minimal repository on GitHub that we can yarn install
and yarn test
.
The project can be considered as a large project with with a lot of images and JS files. When using react native 0.56, the bundling would take +/- 20-30 seconds with the same project.
What is the expected behavior? TheMetro bundler should not choke on projects with lots of images
Please provide your exact Metro configuration and mention your Metro, node, yarn/npm version and operating system.
Metro 0.45.3 Node 8.11.3
React Native Environment Info: System: OS: macOS High Sierra 10.13.6 CPU: x64 Intel® Core™ i7-4770HQ CPU @ 2.20GHz Memory: 745.65 MB / 16.00 GB Shell: 3.2.57 - /bin/bash Binaries: Node: 8.11.3 - ~/.nvm/versions/node/v8.11.3/bin/node npm: 5.6.0 - ~/.nvm/versions/node/v8.11.3/bin/npm Watchman: 4.9.0 - /usr/local/bin/watchman SDKs: iOS SDK: Platforms: iOS 11.4, macOS 10.13, tvOS 11.4, watchOS 4.3 Android SDK: Build Tools: 27.0.3, 28.0.0 API Levels: 23, 25, 26, 27, 28 IDEs: Android Studio: 3.1 AI-173.4819257 Xcode: 9.4.1/9F2000 - /usr/bin/xcodebuild npmPackages: react: ^16.5 => 16.5.1 react-native: ^0.57.0 => 0.57.0 npmGlobalPackages: react-native-cli: 2.0.1 react-native-git-upgrade: 0.2.7 react-native-rename: 2.2.2
Issue Analytics
- State:
- Created 5 years ago
- Reactions:2
- Comments:10 (6 by maintainers)
Top GitHub Comments
I still have this issue. i’m at the very starting point of an AR react native app with Viro media. The metro bundler crashes consistently (but also sometimes is totally fine).
node: v10.4.0 npm: 6.4.1 react native: 0.55.1 OS: mac OS mojave device: iphone x running iOS 12
I think I figured it out. I tracked the files in dev-mode and noticed that it was getting stuck at 99.2% (file 1502/1508) for a long time. The file that was getting transformed after parser.js was the problem:
Solution here: https://github.com/aws/aws-sdk-js/issues/1877