Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

× error: 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

In my case (using Webpack) it was the difference between:

import {MyComponent} from '../components/xyz.js';
vs

import MyComponent from '../components/xyz.js';
The second one works while the first is causing the error. Or the opposite.
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #element #type #expected #string #composite #forgot #export #component #file
ADD COMMENT
Topic
Name
8+1 =