Reputation: 51
I am experiencing the following error after upgrading the expo sdk version to 51.
The errors are
TypeError: Cannot read property 'allowFontScaling' of undefined, js engine: hermes
Invariant Violation: "main" has not been registered. This can happen if:
AppRegistry.registerComponent
wasn't called., js engine: hermesSo I wrote the code on the App.js and it's not working at all. What should I do? `
Text.defaultProps = {
...(Text.defaultProps || {}),
allowFontScaling: false,
};
TextInput.defaultProps = {
...(TextInput.defaultProps || {}),
allowFontScaling: false,
};
Upvotes: 5
Views: 972
Reputation: 1
I had the same issue. For me it was a dependency issue. One of the libraries I was using is not handling 'allowFontScaling' correctly. In order to figure out which library is causing the issue, I did the following:
First, check the error log to see which component is the problem child (see screenshot)
My log is showing some issue with "react-native-button"
Note: If you are using this library in your app then simply update it to the latest version, uninstall it, or patch it and you're done 🎉
In my case, I am not using this component at all in my app, so it likely means that one of my dependencies is using "react-native-button" as a sub-dependency. So you move onto the next step
yarn why react-native-button
This will tell you which library is using the problem code (for me it was react-native-star-rating).
info Reasons this module exists
- "react-native-star-rating" depends on it
- Hoisted from "react-native-star-rating#react-native-button"
Upvotes: 0