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

See original GitHub issue

What’s happening?

Invariant Violation: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely forgot to export your component from the file it’s defined in, or you might have mixed up default and named imports. Check the render method of QRCodeScanner.

How can it be reproduced?

Build details?

“prop-types”: “^15.6.1”, “react”: “16.3.1”, “react-native”: “0.55.3”, “react-native-camera”: “^0.5.1”, “react-native-qrcode-scanner”: “^1.0.1”

windows 8

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
fallerdcommented, Sep 18, 2018

I was able to find this page which described a few solutions: https://github.com/facebook/react-native/issues/16332

I was able to solve this by changing this line: class ScanScreen extends Component { to this: export default class ScanScreen extends Component {

0reactions
matejhocevarcommented, Aug 28, 2018

I’ve same error:

"react": "16.4.1",
"react-native": "0.56.0",
"react-native-camera": "^1.2.0",
"react-native-qrcode-scanner": "^1.0.1"

Link to my repository for reproduce: https://github.com/matoxxx/react-native-qrcode-scanner-error

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 in ...
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-in ... - 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 >
Element type is invalid: expected a string (for ... - OneCompiler
Element type is invalid : expected a string (for built-in components) or a class/function (for composite components) but got: undefined.
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