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: expected a string (for built-in components) or a class/function (for composite components) but got: object.

See original GitHub issue

Test Case 8

Steps to reproduce

Create a new app npm install -g create-react-app create-react-app react-router-params cd react-router-params/

Install react router Install react redux npm install react-router-dom@next

Paste in example lifted directly from docs

Run it npm start

Expected Behavior

Actual Behavior Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: object.

Check the render method of Route.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:2
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

18reactions
catalsdevelopcommented, Feb 7, 2018

I use “react-router-redux”: “^4.0.8”, same error. Change version to “react-router-redux”: “^5.0.0-alpha.9”, then it’s fine

16reactions
stereoboostercommented, Feb 1, 2018

Issue happened because I used "react-router-redux": "^4.0.8", instead of "react-router-redux": "^5.0.0-alpha.9",. I wonder why create-react-app doesn’t warn about undefined imports

Read more comments on GitHub >

github_iconTop Results From Across the Web

Invariant Violation: Element type is invalid: expected a string ...
This error can rise if you try to import a non-existent component. Make sure you have no typo and that the component indeed...
Read more >
(React) Element type is invalid, expected a string (for built ...
To solve the error "Element type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got",...
Read more >
Element type is invalid: expected a string (for built ... - GitHub
The app breaks and gives this error message: Element type is invalid: expected a string (for built-in components) or a class/function (for ......
Read more >
Element type is invalid: expected a string (for built-in ... - Reddit
Getting Error : Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: ...
Read more >
Server Error Error: Element type is invalid: expected a ...
Error: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: ...
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