-
Notifications
You must be signed in to change notification settings - Fork 626
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
FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory #255
Comments
Thanks for reporting! I'm pretty sure that this issue is related to #253 Can you try adding the |
I've been having the same issue. Adding Unfortunately, my release builds are also crashing. Here's the crash:
React Native Environment Info:
I tried the "--max_old_space_size=4096" trick that some sources suggest, but no luck. Same crash in the same spot. I tried the logging trick from the linked issue and discovered that I'm always crashing on the same file:
Here's the offending file: https://github.com/pegjs/pegjs/blob/v0.10.0/lib/parser.js I recently upgraded to react-native 0.57.0 using react-native-git-upgrade and I'm using metro 0.45.3 and babel 7. Here's my .babelrc config if it helps.
I tried bundling just that file and it works fine: https://gist.github.com/paulmand3l/cc54bb6680a6ffeb9a4a1c31efcfe560 |
Thanks for the information! The file that makes the thing crash may be a different one (since this one has already an |
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: aws/aws-sdk-js#1877 |
Whelp, looks like the new react-native/metro doesn't like the "ignore" option. Any suggestions? |
@paulmand3l I had the same issue with metro not liking the patch-package
--- a/node_modules/metro/src/reactNativeTransformer.js
+++ b/node_modules/metro/src/reactNativeTransformer.js
@@ -154,7 +154,12 @@ function transform(_ref) {let filename = _ref.filename,options = _ref.options,sr
// ES modules require sourceType='module' but OSS may not always want that
sourceType: 'unambiguous' },
babelConfig, {
- ast: true }));const ast = _transformSync.ast;
+ ast: true }));
+ if (_transformSync === null) {
+ return { ast: null };
+ }
+
+ const ast = _transformSync.ast;
return { ast }; The code that calls the metro/packages/metro/src/JSTransformer/worker.js Lines 184 to 187 in 8932a9c
|
@jkimbo oh that's actually an issue on the transformer. Do you want to send a PR to fix it? |
Summary: **Summary** Fixes a bug when ignoring a file in the babel config: #255 (comment) **Test plan** Couldn't find any obvious tests that test this part of the code. Happy to add some tests if someone can point me in the right direction. Pull Request resolved: #264 Differential Revision: D10063236 Pulled By: rafeca fbshipit-source-id: 04205b856c513fd90c0ae022c2cbb4deeef0c993
Closing the issue 😄 |
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 |
Do 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
andyarn 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(R) Core(TM) 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
The text was updated successfully, but these errors were encountered: