React-native enable Hot Reload Exception - react-native

I get an exception when I activate the hot reload in react-native.
I have tried to delete node_modules and reinstall them all with npm install but that has not resolved my issue.
My package.json file contains this:

You are on 0.22 of react-native.
There was some errors with hot-reloading in this version that have since been fixed. Most of my errors went away when I upgraded to 0.23. And more errors have been fixed since then.
I would recommend upgrading to react-native to 0.24.
If you are on Windows I would upgrade to 0.23 until this issue is fixed. The issue is fixed in 0.25, but that is still a release candidate.

Related

expo/vector-icons stopped working after upgrading to Expo SDK 47

After upgrading from Expo SDK 46 to 47, the expo icons stopped working. There are errors that say "fontFamily 'Font Awesome' is not a system font and has not been loaded through Font.loadAsync".
I tried deleting package-lock.json, node_modules and .expo folder and npm install again, as well as removing the expo cache. I have restarted my computer, but the problem remains.
I also tried adding the fonts using useFonts hook from expo: https://docs.expo.dev/versions/latest/sdk/font/
I have in my babel.config.js the preset 'babel-preset-expo'.
I don't know what else to do. I am thinking that this is an Expo Bug.
It happened to one of my projects. It may be that you are still using the older version of Xcode. SDK 47 requires Xcode 14.0 or greater. https://blog.expo.dev/expo-sdk-47-a0f6f5c038af

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 Fresh Install Compile Error

I've created a few react-native projects, and since updating to Sierra OSX and Xcode 8, upon opening each project, I get the error:
Application AppName has not been registered. This is either to due to a require() error during initialisation or a failure to call AppRegistry.registerComponent.
I've gone back to basics, uninstalled and reinstalled node, reinstalled latest react-native, created a fresh init, and still get the error. I've looked up and removed the custom-compiler-flags, as suggested here.
This is a real problem, if anyone has any insights I would be very appreciative!
I was having this error last night! All I did was to remove the node_modules, install then again and run the app again, it worked. – Crysfel

Requiring unknown module Object.assign, with ReactNativeTextComponent in the stack trace

I upgraded to the latest react-native (0.23.1) and started getting the error:
I keep getting this error even after downgrading, so not sure if react-native is the cause, or another dependency I have. I could not find this error message by searching Google.
I also tried installing npm install object-assign and that did not help.
I am running babel preset babel-preset-react-native-stage-0.
Turns out the issue was with react. downgrading to React 0.14.8 fixed the issue.
I also meet this question today. Maybe, it is beacuse you upgrade the React to #15.* version. Downgrade the React to #0.14.8 version, it works!

"babelHelpers.interopRequireDefault is not a function" when upgrading to React Native 0.16.0-rc

I upgraded to react-native 0.16.0-rc, ran npm install, then ran react-native upgrade. When trying to launch the iOS app in a simulator (or device, doesn't matter) I get the error:
[error][tid:com.facebook.React.RCTExceptionsManagerQueue] Unhandled JS Exception: babelHelpers.interopRequireDefault is not a function. (In 'babelHelpers.interopRequireDefault(_reactNative)', 'babelHelpers.interopRequireDefault' is undefined)
I've just about run out of ideas here. Is there something I need to add to my xcode project maybe? Merging the latest react-native templates into mine was a nightmare so maybe something got messed up there.
This problem is discussed in this Github issue and fixed by this commit. You can apply this patch temporarily until it is merged into the project with the version 0.16.