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.

Element type is invalid after upgrading to 0.42.2

See original GitHub issue

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

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:6

github_iconTop GitHub Comments

17reactions
chrisz100commented, Mar 1, 2017

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

2reactions
robcalcroftcommented, Mar 20, 2017

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

React Native error: Element type is invalid: expected a string ...
I ran into similar error, but in my case, it is not caused by export but caused by import , and I used...
Read more >
(React) Element type is invalid, expected a string (for built in ...
The error "Element type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got" occurs for...
Read more >
Projects/Vala/Release - GNOME Wiki!
vala: Check if ArrayType supports its given element-type in analyzer pass ... Report error for invalid base access in method/property of compact class....
Read more >
Changelog | Meteor API Docs
Remove @types/meteor package; Install zodern:types package; Follow installation guide for the ... Fixes invalid package.json files breaking Meteor run.
Read more >
Why do I keep getting this error: "Element type is invalid" when ...
I've tried inserting the component into another one, but still getting the same error. I installed svgr/webpack by running: npm install @svgr/ ...
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