question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Invariant Violation issue

See original GitHub issue

I have gone through these following points

Issue Description

A long time i have been trying to revive an old project, when i started the project ran on react-native version 0.49.5. I am finally able to compile it through native base now, without having it crash, but as soon as the project runs on a device i get the error down below. I have tried googling it, but theres nothing regarding my error. I assume the app crashes because of the NaN in fontSize. But unfortunately i have to admit defeat at this point.

Node version 12.8.0 npm version 6.10.3 react-native 0.60.5 native-base (current) 2.12.0, have tried with 2.13.5, same result.

Expected behaviour

App should render first action in mainactivity.

Actual behaviour

Crashes with the following error `nvariant Violation: [15,“RCTText”,11,{“fontSize”:“< < NaN > >”,“fontFamily”:“Roboto”,“color”:-1,“backgroundColor”:0,“padding”:4,“textAlign”:“center”,“accessible”:true,“allowFontScaling”:true,“ellipsizeMode”:“tail”}] is not usable as a native method argument

This error is located at: in RCTText (at Text.js:159) in TouchableText (at Text.js:283) in Text (at Text.js:26) in Text (at connectStyle.js:392) in Styled(Text) (at LoginScreen.js:186) in RCTView (at View.js:35) in View (at View.js:10) in ViewNB (at connectStyle.js:392) in Styled(ViewNB) (at LoginScreen.js:415) in RCTView (at View.js:35) in View (at ScrollView.js:1007) in RCTScrollView (at ScrollView.js:1147) in ScrollView (at KeyboardAwareHOC.js:508) in KeyboardAwareScrollView (at Content.js:66) in Content (at connectStyle.js:392) in Styled(Content) (at LoginScreen.js:414) in RCTView (at View.js:35) in View (at ImageBackground.js:63) in ImageBackground (at LoginScreen.js:237) in RCTView (at View.js:35) in View (at Container.js:12) in Container (at connectStyle.js:392) in Styled(Container) (at LoginScreen.js:236) in LoginComponent (created by Connect(LoginComponent)) in Connect(LoginComponent) (at SceneView.js:17) in SceneView (at CardStack.js:455) in RCTView (at View.js:35) in View (at CardStack.js:454) in RCTView (at View.js:35) in View (at CardStack.js:453) in RCTView (at View.js:35) in View (at createAnimatedComponent.js:151) in AnimatedComponent (at Card.js:12) in Card (at PointerEventsContainer.js:39) in Container (at CardStack.js:498) in RCTView (at View.js:35) in View (at CardStack.js:414) in RCTView (at View.js:35) in View (at CardStack.js:413) in CardStack (at CardStackTransitioner.js:67) in RCTView (at View.js:35) in View (at Transitioner.js:142) in Transitioner (at CardStackTransitioner.js:19) in CardStackTransitioner (at StackNavigator.js:41) in Unknown (at createNavigator.js:13) in Navigator (at createNavigationContainer.js:226) in NavigationContainer (at App.js:61) in Provider (at App.js:60) in StyleProvider (at App.js:59) in App (at renderApplication.js:40) in RCTView (at View.js:35) in View (at AppContainer.js:98) in RCTView (at View.js:35) in View (at AppContainer.js:115) in AppContainer (at renderApplication.js:39)`

Steps to reproduce

Ran native-base android-run, the app runs just fine through the compiler. But then proceeds to throw out this error.

Is the bug present in both iOS and Android or in any one of them?

Android only, as we are only developing for android. And havent tested it on iOS.

Any other additional info which would help us debug the issue quicker.

No additional info, ANY tips regarding this issue will be accepted with open arms. Also this is the first time i have ever created any form of official issue, so if i have made any mistakes at some point, please point them out, and i will do my best to correct myself. Thank you for reading.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
keshakishorecommented, Sep 12, 2019

I faced the same problem with cardItem and Header only when I’m using StyleProvider with custom theme (Created using Native Base customiser). Solved it by adding cardItemPadding: null platform: Platform.OS or just use the platform variable declared at the top. in native-base-theme/variables/variables.js file

Screen Shot 2019-09-11 at 10 32 35 AM Screen Shot 2019-09-11 at 10 55 56 AM

`export default { //header fix platformStyle: ‘platform’, platform, androidRipple: true, androidRippleColor: ‘rgba(256, 256, 256, 0.3)’, androidRippleColorDark: ‘rgba(0, 0, 0, 0.15)’, btnUppercaseAndroidText: true,

// card fix cardItemPadding: null, … } `

Read more comments on GitHub >

github_iconTop Results From Across the Web

ReactJs "Invariant violation..." Classic react issue
I just want to render my table lines dynamically but I get the error:" "Uncaught Error: Invariant Violation: processUpdates(): Unable to find ...
Read more >
ERROR Invariant Violation: Module AppRegistry is not a ...
ERROR Invariant Violation: Module AppRegistry is not a registered callable module (calling runApplication). A frequent cause of the error is ...
Read more >
Invariant Violation: Objects are not valid as a React child
Sometimes you might try to display data in a React application and you might see the following error in the console: Objects are...
Read more >
Troubleshooting common React Native bugs - LogRocket Blog
Invariant Violation : Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but ...
Read more >
[Network error]: Invariant Violation: request is not implemented ...
Your original issue was due to the fact that if you initialize a plain old ApolloLink instance (as opposed to a predefined subclass...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found