undefined is not a function (evaluating 'transform.forEach') - react-native

When I run a new react-native app in Android device I am getting this Error:
undefined is not a function (evaluating 'transform.forEach')
I had
node version 7.9.0
react-native-cli version 2.0.1
react-native version 0.44.0
npm version 4.2.0
I use Windows 10 (64 bit).

After six hours spent debugging react proptype validation and then digging a level deeper into packaging internals, I figured out a brain-dead simple solution:
react-native start --reset-cache

I've read a lot and tried all different answers, but after days trying, here is what works:
- Run terminal in admin mode (I'm under windows)
- Change the directory to another with a shortest path
- Change the directory to outside dropbox
- Pushed the code from GIT (starting from zero)
I can't say what step is the responsible, but it's a little effort to do everything in the same time... And it worked!

Related

TypeError: global.__reanimatedWorkletInit is not a function. (In 'global.__reanimatedWorkletInit(_f)', 'global.__reanimatedWorkletInit' is undefined)

TypeError: global.__reanimatedWorkletInit is not a function. (In 'global.__reanimatedWorkletInit(_f)', 'global.__reanimatedWorkletInit' is undefined)
I am using React Native (not expo). I don't even have reanimated downloaded. I had it downloaded then I removed it and rebuilt the app, and it's giving me this error now.
Things I've tried:
deleting node_modules and re-running yarn install
-git reset HEAD~ to a prev commit where I didn't install the reanimated2 packages
I just followed the below steps to solve this issue.
step1: npx react-native run-android
step2: npm start -- --reset-cache
and it solved
Ok, what I ended up doing to solve this was:
-just deleted the whole repo from my local
-cloned it again from github
-uninstalled the app from Android emulator
Then it seemed to work. So maybe it was an error related to cache or something lingering around even after I had removed all instances of the word/package "reanimated" from the whole codebase.
Using Expo in a bareworkflow
Clear app memory
run expo start --dev-client --clear
I solved my issue doing this:
https://github.com/wcandillon/react-native-redash/issues/395
On top you just have to do this: import 'react-native-reanimated';
on your app or index file.
I have tried all the solutions from stack Overflow. (Not working)
Here is the fix:
first check your version for react-native-reanimated and then see the actual documentation of the right version for the configuration.
I am using version 2.4.1 and have solved by this link
I had a require cycle warning from a git submodule inside the src folder which I thought wasn't doing any harm but turns out fixing that solved this issue. I am unsure why the require cycle was causing so much grief but I guess if you've got a require cycle in your output try solving that and it may fix this.
What I did was degrading react-native-reanimated to ^2.6.0. It solved the issue for me.
I had this problem too and simply moved the babel plugin react-native-reanimated/plugin to the last place in the babel's config as stated in the doc.
I should probably mention it worked for me before but when I started migrating the react-native app for web this was the problem for me. I am using expo. I had to run expo with --clear CLI arg as expo start --dev-client --clear.
I Just solved this issue by doing these steps:
close Metro bundler
run this command
npm start -- --reset-cache
react-native start --reset-cache
rebuild the project again

React Native stuck at loading dependecy graph

Good Day, I am pretty new to react native and I ran into an issue, my metro bundler starts and gets stuck at loading dependency graph with ('...'), not moving forward or backwards
I have tried using yarn start, changing the ports although my port 8081 is free.
Any other suggestions would be appreciated.
EDIT: any other alternatives to metro bundler?
Screenshot:Its just stuck here
Screenshot II: Emulator
Turns out it was my node version, was using v12, I downgraded to v10.
Thanks for your suggestions.
Did you run react-native run-ios or react-native run-android as well?
because react-native start only runs metro and usually when dependency graph is done it stays there hanging until you connect a simulator/device but it is working as expected.
You can try with react-native --reset-cache to clean up metro after some bad start, but in any case this only starts metro bundler. To get device running use the methods above
For the latest version of RN 0.62, there could be two things that could be wrong.
Make sure your node version is < 12.15 since there is a memory leak issue and you would have few issues running the bundler.
If you are in MacOs Catalina , just go to the Security & Privacy -> files & folders in the system preferences and change the permissions for watchman.
The simplest way to debug this issue is running the bundler in sudo
sudo react-native start
And if you have permission issue with watchman then you should see bunch of errors in your console.

cannot create iOS folder on my react native app

I am asking this question for the third time and I don't get it why no one even tries to help on this, is this question not well explained? If you can ask for more information I can give!
I am having trouble created iOS folder inside my react native app(detached) as when I created the app I created it from windows machine and iOS folder didn't come when I wrote: exp detach
Now that I have got a macOS, how can I get to create iOS folder so I can use that to build from xCode. I tried react-native upgrade, this is telling me that I have some version conflicts, so I don't want to upgrade it actually, I just want to have iOS folder on my react native.
What would be the best solution in here?
Interestingly I tried exp detach over my detached app and it created iOS, it's working! hopefully this will help anyone!
Please follow the below steps:
Step I: Ensure below installable are installed
Java Sdk Android Studio
Xcode (in case of OSX)
HomeBrew (in case of OSX to install node)
Node/NPM (Node runs Javascript outside the browser. NPM is used for installing and managing Dependencies. Node and NPM come
together)
Those are some essential installs that you will need in your Project
**Step II: **
For windows/OSX you need to run the following commands in your command prompt/command line:
This is the important part for running a react native project:
**Step II: **
npm install -g react-native-cli
Then you can use this cli to start a new project like this:
**Step III: **
react-native init
Hope this helped you, please vote..

React cannot find entry file in any of the roots update

I have the following warning when running react-native run-ios:
I know that the question was asked before, but the solutions doesn't seem to work for me... I restarted my OS and it's still not working...
Any ideas?
As I noted in the comments, you can check this github link
The workaround from that thread that seems to work consistently (at least in my case) is to do these steps:
In the current terminal: react-native start
In another terminal: react-native run-android
The issue now is with the current version of react-native: 0.45.0.
I downgraded to the 0.44.0 version with react-native-git-upgrade 0.44.0 and it works fine now!

TransformError react native 0.7.1

when i build my react-native application using Xcode and launch it, the emulator shows the error red screen with the following message:
TransformError: /path/to/app/index.ios.js: /path/to/app/index.ios.js: Cannot read property 'line' of undefined]
message: 'TransformError: /path/to/app/index.ios.js: /path/to/app/index.ios.js: Cannot read property \'line\' of undefined',
I've built one application a month ago with react-native v 0.4.x and i've never had this message.
I've tried with node 0.12 and different versions of iojs
I'm using react-native v0.7.1 and xCode v6.4
The project is totally empty of any code wrote by me, i just:
$ react-native init reactNat (with react-native-cli v0.1.4)
I read that now react-native is directly integrated with babel and I suppose the problem came from that but with no more clues.
If anybody have an idea it would be very nice!
Thanks guys
You'll need to use node.js >= 4.0, as per the 'getting started' guide. You can use nvm to install multiple node versions on your system.