react-native
react-native copied to clipboard
TypeError: undefined is not an object (evaluating '_reactNative.Text.propTypes.allowFontScaling)
New Version
0.69.4
Old Version
0.64.2
Build Target(s)
13
Output of react-native info
(Use node --trace-warnings ...
to show where the warning was created)
System:
OS: macOS 12.1
CPU: (16) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
Memory: 157.31 MB / 16.00 GB
Shell: 5.8 - /bin/zsh
Binaries:
Node: 16.14.2 - ~/.nvm/versions/node/v16.14.2/bin/node
Yarn: 1.22.11 - /usr/local/bin/yarn
npm: 8.5.0 - ~/.nvm/versions/node/v16.14.2/bin/npm
Watchman: 2022.07.04.00 - /usr/local/bin/watchman
Managers:
CocoaPods: 1.11.3 - /usr/local/bin/pod
SDKs:
iOS SDK:
Platforms: DriverKit 21.4, iOS 15.5, macOS 12.3, tvOS 15.4, watchOS 8.5
Android SDK:
API Levels: 23, 25, 27, 28, 29, 30, 31
Build Tools: 28.0.3, 29.0.2, 29.0.3, 30.0.2, 30.0.3, 31.0.0, 33.0.0
System Images: android-28 | Intel x86 Atom_64, android-28 | Google APIs Intel x86 Atom, android-29 | Intel x86 Atom_64, android-29 | Google APIs Intel x86 Atom, android-30 | Google APIs Intel x86 Atom, android-30 | Google Play Intel x86 Atom
Android NDK: Not Found
IDEs:
Android Studio: 4.2 AI-202.7660.26.42.7322048
Xcode: 13.4.1/13F100 - /usr/bin/xcodebuild
Languages:
Java: 11.0.15 - /Library/Java/JavaVirtualMachines/jdk-11.0.15.jdk/Contents/Home/bin/javac
npmPackages:
@react-native-community/cli: Not Found
react: 18.0.0 => 18.0.0
react-native: 0.69.4 => 0.69.4
react-native-macos: Not Found
npmGlobalPackages:
react-native: Not Found
Issue and Reproduction Steps
ERROR TypeError: undefined is not an object (evaluating '_reactNative.Text.propTypes.allowFontScaling') ERROR Invariant Violation: Module AppRegistry is not a registered callable module (calling runApplication). A frequent cause of the error is that the application entry file path is incorrect. This can also happen when the JS bundle is corrupt or there is an early initialization error when loading React Native. LOG register Voip push notification token is here ERROR Invariant Violation: Module AppRegistry is not a registered callable module (calling runApplication). A frequent cause of the error is that the application entry file path is incorrect. This can also happen when the JS bundle is corrupt or there is an early initialization error when loading React Native.
I am also facing the same problem, during the upgrade from 0.68.2 to 0.69.4. Any solution?
Hello @internationthink and @sarathdb 👋
I'd suggest you to first check your code if you are not using propTypes.allowFontScaling
somewhere. If not, maybe you are using some deprecated third-party dependencies that are using these properties ?
For example react-native-button
or react-native-settings-list
are using these deprecated properties and requires a patch as explained here : https://github.com/ide/react-native-button/issues/92
Hope this can give you a hint on how to fix this issue 🙂
Best regards.
PS : you can use a command like grep -R "propTypes.allowFontScaling" *
on your project directory to find all occurrences in your code.
I am also facing the same problem, after upgrade from 0.63.2 to 0.69.4.
Anyone please provide any solution?
Errors :- 1-TypeError: undefined is not an object (evaluating '_reactNative.Text.propTypes.allowFontScaling') 2-Invariant Violation: Module AppRegistry is not a registered callable module (calling runApplication). A frequent cause of the error is that the application entry file path is incorrect. This can also happen when the JS bundle is corrupt or there is an early initialization error when loading React Native.
Same problem
Did you find a solution?
Same problem.
same problem.
Same Here.
In My case i using react-native-star-rating depend react-native-button, so i need fix with patch
`diff --git a/node_modules/react-native-button/Button.js b/node_modules/react-native-button/Button.js index fb7cf46..f776b52 100644 --- a/node_modules/react-native-button/Button.js +++ b/node_modules/react-native-button/Button.js @@ -6,6 +6,7 @@ import { TouchableOpacity, View, ViewPropTypes,
- TextStyle } from 'react-native';
import coalesceNonElementChildren from './coalesceNonElementChildren'; @@ -16,12 +17,12 @@ export default class Button extends Component { static propTypes = { ...TouchableOpacity.propTypes, accessibilityLabel: PropTypes.string,
- allowFontScaling: Text.propTypes.allowFontScaling,
- allowFontScaling: PropTypes.bool, containerStyle: ViewPropTypes.style, disabledContainerStyle: ViewPropTypes.style, disabled: PropTypes.bool,
- style: Text.propTypes.style,
- styleDisabled: Text.propTypes.style,
- style: PropTypes.shape(TextStyle),
- styleDisabled: PropTypes.shape(TextStyle), childGroupStyle: ViewPropTypes.style, };
`
if you have other lib please check grep -R "propTypes.allowFontScaling" *
to find and fix
Now my project 0.69.1 worked
how you did it ?
how you did it ?
It helps me:
Install 'deprecated-react-native-prop-types', go to 'node_modules/react-native-button/Button.js', import there:
import {TextPropTypes} from 'deprecated-react-native-prop-types'
Change 'static propTypes' to
static propTypes = { ... allowFontScaling: TextPropTypes.allowFontScaling, ... style: TextPropTypes.style styleDisabled: TextPropTypes.style, ... };
And restart the project without cache.
Of course, to save changed dependencies, I advise you to use 'patch package': https://www.npmjs.com/package/patch-package
Thank you
In my case, on upgrade RN 0.68.5 to RN 0.69.7, get like error. I solved refacting the property "Text.propTypes.style" to "PropTypes.string" in my app and that's work's fine again.
Edit: I didn't change files of React Native. Just my own files and properties. @karankapur999.
@sergiocabreu
could you please share in what all files you changed it ?
i face the same issue i tried every solution even i tried developers on freelancer no one could know what is wrong idont use PropTypes any where after i have done the react native index file solution another problem showed TypeError: undefined is not an object (evaluating '_reactNative.Text.propTypes.style') i am really frustrated please any help!
same issue, on expo upgrade from 45 to 46 and following the deprecated-props update.
same issue, on expo upgrade from 45 to 46 and following the deprecated-props update.
Did you find a solution?
same issue, on expo upgrade from 45 to 46 and following the deprecated-props update.
Did you find a solution?
Yep, check out my stack overflow post, just follow the steps I mention and you should succeed https://stackoverflow.com/questions/75901284/issue-with-viewproptypes-styles-after-upgrading-expo-from-45-to-46-and-fixing
This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 7 days.
This issue was closed because it has been stalled for 7 days with no activity.
Text.propTypes.style
ERROR TypeError: undefined is not an object (evaluating '_reactNative.Text.propTypes.style') ERROR Invariant Violation: Module AppRegistry is not a registered callable module (calling runApplication). A frequent cause of the error is that the application entry file path is incorrect. This can also happen when the JS bundle is corrupt or there is an early initialization error when loading React Native. ERROR Invariant Violation: Module AppRegistry is not a registered callable module (calling runApplication). A frequent cause of the error is that the application entry file path is incorrect. This can also happen when the JS bundle is corrupt or there is an early initialization error when loading React Native.
Facing this issue, can anyone help me on this please