React-native: Element type is invalid after upgrading to 0.42.2

Created on 26 Feb 2017  路  6Comments  路  Source: facebook/react-native

Description

After upgrading from react-native 0.42.1 to 0.42.2 I get the following error:
Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: object.

I am using the following two libraries: react-native-router-flux and react-native-maps

The maps are not active and the error appears right after launch. I tried deactivating react-native-router-flux but the error persists.

I upgraded using the following commands:
$ react-native-git-upgrade $ react-native upgrade $ react-native link

After this was not working I also tried to remove node_modules, npm install and relink the libraries, but same behavior.

All went through fine, but as soon as the app starts I don't see any content but the error. If I dismiss it the page remains white and empty.

Additional Information

  • React Native version: 0.42.2
  • Platform: both
  • Operating System: macOS
Locked

Most helpful comment

My node version requires me to use import the following way:
import App from './app/index';
instead of
import App from './app';

All 6 comments

Inclusion error, please see as resolved.

How did you solve this?

My node version requires me to use import the following way:
import App from './app/index';
instead of
import App from './app';

perfect!

In addition to @chrisz100 's comment, this issue arises as RN adds an app.json file which confuses the import as its ambiguous between the app folder and the app.json file.

@chrisz100 Holy crap - this should be raised up more.. people waste hours trying to figure what the hell.... Thanks for this.

Always getting screwed over with React-Native I feel. Will there ever be a library that doesn't break all the rest of your stuff? Looking forward to that day.

Was this page helpful?
0 / 5 - 0 ratings