Closed ospfranco closed 2 years ago
I tried npm install and that installs fine... so I guess yarn 1 is no longer supported?
I use yarn v1 on my machine and I don't hit that issue - maybe try to clean up some yarn caches? It's a weird one for sure. Does it also happen for you on a fresh-ly init'd project? A repro would really help
I have the same issue with yarn, I've tried removing node_modules and also yarn cache clean
<--- Last few GCs --->
[1900:0x1048d8000] 114707 ms: Scavenge (reduce) 4080.6 (4100.8) -> 4079.9 (4101.8) MB, 5.3 / 0.0 ms (average mu = 0.149, current mu = 0.050) allocation failure
[1900:0x1048d8000] 114722 ms: Scavenge (reduce) 4080.6 (4103.8) -> 4080.2 (4104.5) MB, 12.1 / 0.0 ms (average mu = 0.149, current mu = 0.050) allocation failure
<--- JS stacktrace --->
FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
1: 0x101306bb5 node::Abort() (.cold.1) [/usr/local/bin/node]
2: 0x1000ad6c9 node::Abort() [/usr/local/bin/node]
3: 0x1000ad82f node::OnFatalError(char const*, char const*) [/usr/local/bin/node]
4: 0x1001f1b97 v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [/usr/local/bin/node]
5: 0x1001f1b33 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [/usr/local/bin/node]
6: 0x10039f695 v8::internal::Heap::FatalProcessOutOfMemory(char const*) [/usr/local/bin/node]
7: 0x1003a113a v8::internal::Heap::RecomputeLimits(v8::internal::GarbageCollector) [/usr/local/bin/node]
8: 0x10039c865 v8::internal::Heap::PerformGarbageCollection(v8::internal::GarbageCollector, v8::GCCallbackFlags) [/usr/local/bin/node]
9: 0x10039a190 v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [/usr/local/bin/node]
10: 0x1003a88ba v8::internal::Heap::AllocateRawWithLightRetrySlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [/usr/local/bin/node]
11: 0x1003a8941 v8::internal::Heap::AllocateRawWithRetryOrFailSlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [/usr/local/bin/node]
12: 0x100376712 v8::internal::Factory::NewFillerObject(int, bool, v8::internal::AllocationType, v8::internal::AllocationOrigin) [/usr/local/bin/node]
13: 0x1006f64c8 v8::internal::Runtime_AllocateInYoungGeneration(int, unsigned long*, v8::internal::Isolate*) [/usr/local/bin/node]
14: 0x100a7c3f9 Builtins_CEntry_Return1_DontSaveFPRegs_ArgvOnStack_NoBuiltinExit [/usr/local/bin/node]
15: 0x100a63fad Builtins_SetConstructor [/usr/local/bin/node]
16: 0x100a11401 Builtins_JSBuiltinsConstructStub [/usr/local/bin/node]
17: 0x528b3c2b565
18: 0x528b3c3284e
19: 0x528b3c3adb9
20: 0x100a15282 Builtins_InterpreterEntryTrampoline [/usr/local/bin/node]
Have you found a solution yet? This is happening to me too, I tried the following:
yarn upgrade-interactive --latest
which is my usual and normally works wellNODE_OPTIONS=--max_old_space_size=10240 yarn upgrade-interactive --latest
package.json
to 0.65
and then rm -rf node_modules
then yarn
and also with NODE_OPTIONS=--max_old_space_size=10240
option but also didn't workThen I tried npx react-native init test
and it worked
I use https://react-native-community.github.io/upgrade-helper/?from=0.64.2&to=0.65.0
I have the same issue with yarn
Also getting the same issue with yarn
, on both OSX and Linux.
I tried npm install and that installs fine... so I guess yarn 1 is no longer supported?
I use yarn v1 on my machine and I don't hit that issue - maybe try to clean up some yarn caches? It's a weird one for sure. Does it also happen for you on a fresh-ly init'd project? A repro would really help
I tried a fresh project and there it is working, I even copied my package.json section by section trying to see if something would fail, then started copying other files, like my patches from patch-package
, react-native.config.js
, until eventually copying all the source code (src, ios, android, etc) and nothing, on a fresh project it works fine
when running yarn --verbose here is the output
Seems to hang always at the eslint-plugin dependency, after removing yarn.lock and installing fresh it works
when running yarn -verbose on my side
(...)
warning " > react-test-renderer@17.0.1" has incorrect peer dependency "react@17.0.1".
verbose 34.213907711 Selecting "react@17.0.2" at level 0 as the peer dependency of "react-shallow-renderer@16.14.1".
warning " > redux-flipper@1.4.2" has incorrect peer dependency "react-native@^0.63.0".
warning " > redux-flipper@1.4.2" has incorrect peer dependency "react-native-flipper@^0.63.0".
verbose 34.215225958 Selecting "redux@4.0.5" at level 0 as the peer dependency of "redux-flipper@1.4.2".
<--- Last few GCs --->
[4534:0x1048d8000] 140805 ms: Scavenge (reduce) 4081.7 (4100.8) -> 4081.1 (4101.8) MB, 3.7 / 0.0 ms (average mu = 0.171, current mu = 0.073) allocation failure
[4534:0x1048d8000] 140839 ms: Scavenge (reduce) 4081.7 (4103.8) -> 4081.3 (4104.3) MB, 32.2 / 0.0 ms (average mu = 0.171, current mu = 0.073) allocation failure
<--- JS stacktrace --->
FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
(...)
Ok its working with yarn and rn 0.65 if you update your devDependencies like that :
"@babel/core": "^7.15.0",
"@babel/runtime": "^7.15.3",
"@react-native-community/eslint-config": "^3.0.0",
"metro-react-native-babel-preset": "^0.66.2",
@manuhook interesting, what did you have before those? I can see in the template that we set
"@babel/core": "^7.12.9",
"@babel/runtime": "^7.12.5",
"@react-native-community/eslint-config": "^2.0.0",
"metro-react-native-babel-preset": "^0.66.0",
And folks seem to report that on fresh-ly init'd projects those deps work fine 🤔
@kelset I had this for rn 0.64.2
"@babel/core": "^7.12.9",
"@babel/runtime": "^7.12.5",
"@react-native-community/eslint-config": "^2.0.0",
"metro-react-native-babel-preset": "^0.64.0",
Can confirm, updating devDependencies as @manuhook suggests fixed the issue for me. It's worth stating that once changes were made to the yarn.lock
, I was able to revert those devDependencies back to their original state and everything continues to install correctly. This lends to the behavior others are seeing, which is that fresh projects aren't getting this same error.
Ok its working with yarn and rn 0.65 if you update your devDependencies like that :
"@babel/core": "^7.15.0", "@babel/runtime": "^7.15.3", "@react-native-community/eslint-config": "^3.0.0", "metro-react-native-babel-preset": "^0.66.2",
This is actually what's on my package.json
, but still fails.
"dependencies": {
"@react-native-community/masked-view": "^0.1.11",
"@react-native-community/netinfo": "^6.0.0",
"@react-native-firebase/analytics": "^12.6.1",
"@react-native-firebase/app": "^12.6.1",
"@react-native-firebase/crashlytics": "^12.6.1",
"@react-native-firebase/messaging": "^12.6.1",
"@react-navigation/bottom-tabs": "^6.0.5",
"@react-navigation/drawer": "^6.1.4",
"@react-navigation/native": "^6.0.2",
"@react-navigation/stack": "^6.0.7",
"color": "^4.0.1",
"date-fns": "^2.23.0",
"expo-image-picker": "^10.2.2",
"fluxible-js": "^5.0.11",
"hermes-engine": "0.7.2",
"husky": "7.0.1",
"jsc-android": "^250230.2.1",
"patch-package": "^6.4.7",
"postinstall-postinstall": "^2.1.0",
"react": "17.0.2",
"react-fluxible": "^5.0.4",
"react-native": "0.64.2",
"react-native-add-calendar-event": "^4.0.0",
"react-native-animatable": "^1.3.3",
"react-native-background-timer": "^2.4.1",
"react-native-bootsplash": "^3.2.4",
"react-native-bouncy-checkbox": "^2.1.3",
"react-native-camera-kit": "^11.2.1",
"react-native-config": "^1.4.3",
"react-native-device-info": "^8.3.0",
"react-native-fs": "^2.18.0",
"react-native-gesture-handler": "^1.10.3",
"react-native-google-places": "^3.1.2",
"react-native-maps": "^0.28.0",
"react-native-mime-types": "^2.3.0",
"react-native-modalize": "^2.0.8",
"react-native-paper": "^4.9.2",
"react-native-permissions": "^3.0.5",
"react-native-portalize": "^1.0.7",
"react-native-push-notification-popup": "^1.6.0",
"react-native-qrcode-svg": "^6.1.1",
"react-native-reanimated": "^2.2.0",
"react-native-responsive-image-view": "^2.1.0",
"react-native-safe-area-context": "^3.3.0",
"react-native-screens": "^3.5.0",
"react-native-sensitive-info": "^6.0.0-alpha.8",
"react-native-svg": "^12.1.1",
"react-native-unimodules": "^0.14.6",
"react-native-vector-icons": "^8.1.0",
"react-native-walkthrough-tooltip": "^1.2.0",
"rn-placeholder": "^3.0.3",
"uuid": "^8.3.2"
},
"devDependencies": {
"@babel/core": "^7.15.0",
"@babel/eslint-parser": "^7.15.0",
"@babel/runtime": "^7.15.3",
"@react-native-community/eslint-config": "^3.0.0",
"babel-jest": "^27.0.6",
"babel-plugin-module-resolver": "^4.0.0",
"babel-plugin-optional-require": "^0.3.1",
"babel-plugin-transform-remove-console": "^6.9.4",
"command-line-args": "^5.2.0",
"eslint": "^7.32.0",
"eslint-import-resolver-babel-module": "^5.3.1",
"eslint-plugin-import": "^2.24.0",
"eslint-plugin-module-resolver": "^1.4.0",
"eslint-plugin-react-hooks": "^4.2.0",
"jest": "^27.0.6",
"lint-staged": "^11.1.2",
"metro-react-native-babel-preset": "^0.66.2",
"prettier": "^2.3.2",
"react-native-version": "^4.0.0",
"react-test-renderer": "17.0.2",
"source-map": "^0.7.3"
},
EDIT:
I just tried it again, and it worked
@kelset I had this for rn 0.64.2
"@babel/core": "^7.12.9", "@babel/runtime": "^7.12.5", "@react-native-community/eslint-config": "^2.0.0", "metro-react-native-babel-preset": "^0.64.0",
Thanks, I had the same problem on Windows and I was able to fix with this
does anyone else experience this? https://github.com/facebook/react-native/issues/32044
Following these suggested steps I get an error in metro itself immediately upon requesting index.js
for iOS or Android:
error: index.js: Unknown option: .cloneInputAst. Check out https://babeljs.io/docs/en/babel-core/#options for more information about options.
I've tried using react-native start --reset-cache
for metro itself, but doesn't seem to make any difference.
Following these suggested steps I get an error in metro itself immediately upon requesting
index.js
for iOS or Android:error: index.js: Unknown option: .cloneInputAst. Check out https://babeljs.io/docs/en/babel-core/#options for more information about options.
I've tried using
react-native start --reset-cache
for metro itself, but doesn't seem to make any difference.
This issue happens to me as well
Here I had to bump @react-native-community/eslint-config
to ^3.0.0
, and remove yarn.lock
Here I had to bump
@react-native-community/eslint-config
to^3.0.0
, and removeyarn.lock
Removing yarn.lock
is always a bad solution, even though 99% of the time it will fix the issue, but for existing projects with a large number of dependencies might break.
I wanted to indicate what helped for us. We were using a custom hermes-engine
version versus the one that is built into RN (there was a bug that occurred that required us to use this strategy).
I was having the exact same issue as stated above and all my depdencies were correct per other posters. However I discovered that we were behind in our hermes version. Upgrading hermes-engine
to the version that supports 65 (0.8.1
) allowed us to yarn without having to delete the yarn lock.
it doesn't look like a solution is coming soon from the RN team, because this is a conflict with some previous state of yarn.lock... so I'm just going to close it, since the workaround is clear. Update your dependencies mix/match, at some point your build should unlock itself.
I ended up removing all dependencies to just these 4, and the culprit for us was @babel/core
preventing us from installing. I was able to get yarn install
to work with different versions here, but I end up with errors when compiling via metro itself after the app boots.
{
"dependencies": {
"react": "17.0.2",
"react-native": "0.65.1"
},
"devDependencies": {
"@babel/core": "7.12.9",
"react-native-codegen": "^0.0.7"
}
}
I ended up removing all dependencies to just these 4, and the culprit for us was
@babel/core
preventing us from installing. I was able to getyarn install
to work with different versions here, but I end up with errors when compiling via metro itself after the app boots.{ "dependencies": { "react": "17.0.2", "react-native": "0.65.1" }, "devDependencies": { "@babel/core": "7.12.9", "react-native-codegen": "^0.0.7" } }
Thank @macfanatic this saved me a lot of debugging time.
I ended up removing all dependencies to just these 4, and the culprit for us was
@babel/core
preventing us from installing. I was able to getyarn install
to work with different versions here, but I end up with errors when compiling via metro itself after the app boots.{ "dependencies": { "react": "17.0.2", "react-native": "0.65.1" }, "devDependencies": { "@babel/core": "7.12.9", "react-native-codegen": "^0.0.7" } }
Thank @macfanatic this saved me a lot of debugging time.
In the end the suggestion to force resolve to babel 7.12.x
is the only thing that has allowed me to run yarn install
and actually run metro without errors. Insane that this has taken so so so many hours to figure out.
https://github.com/oblador/react-native-vector-icons/issues/1334#issuecomment-862148812
You need exactly these two versions:
"@babel/core": "7.12.9",
"@babel/runtime": "7.12.5",
Then yarn start --reset-cache
. Try to always match the versions in the template.
You need exactly these two versions:
"@babel/core": "7.12.9", "@babel/runtime": "7.12.5",
Then
yarn start --reset-cache
. Try to always match the versions in the template.
Matching the template is definitely my goal, but didn't work for our project. yarn start --reset-cache
would never run, because just a simple yarn install
first required, failed. Perhaps it works for others, this was definitely the most problematic upgrade to this roughly 4 year old RN project from a dependency standpoint.
At the beginning, rn 0.64.2 with the package.json below is ok for me:
"react-native": "0.64.2",
"@babel/core": "^7.12.9",
"@babel/runtime": "^7.12.5",
"metro-react-native-babel-preset": "^0.64.0"
but after upgrading rn to 0.67.0-rc.6, then i met the out of memory error. Finally I find upgrading those dependecies help me get out of this error:
"react-native": "0.67.0-rc.6",
"@babel/core": "^7.16.5",
"@babel/runtime": "^7.16.5",
"metro-react-native-babel-preset": "^0.66.2"
The fix suggested by @coolguy001tv
"@babel/core": "^7.16.5",
"@babel/runtime": "^7.16.5",
worked for me to fix FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
that showed up when upgrading from 0.64.2
to 0.67.3
These dependency updates should be listed in the react native upgrade helper.
Description
I'm trying to upgrade to 0.65 from 0.64.2, I updated the code based on the upgrade helper, however when I try to run
yarn
to install the dependencies nothing happens for a while and then I get a heap out of memory error...Environment
Running on a m1 air with 16gb of ram, I also tried clearing my node_modules and using a different node version (16)
Here is a partial package.json:
Edit
I tried
npm install
and that installs fine... so I guess yarn 1 is no longer supported?