Details: 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 t
It's just an error but on development server it works!. On gatsby develop
everything works perfectly but when i do gatsby build
and drop files on github pages it raises this minified error. What is going on?
I'm also getting this error, and it's very difficult to debug :(
EDIT: @jimfilippou I fixed it by setting the type of children in src/layouts/index.js
to any
like this:
TemplateWrapper.propTypes = {
children: PropTypes.any,
}
I added babel-plugin-transform-react-remove-prop-types
which I thought removed prop types all together, so I thought this would eliminate prop validation errors, but I guess I don't understand that plugin properly.
Good call , in my case it was a npm package. When i rebuild my app it was working properly but i will follow your proptypes it seems better than mine
I recommend PropTypes.node
, it's more specific than any
and works too.
Most helpful comment
I'm also getting this error, and it's very difficult to debug :(
EDIT: @jimfilippou I fixed it by setting the type of children in
src/layouts/index.js
toany
like this:I added
babel-plugin-transform-react-remove-prop-types
which I thought removed prop types all together, so I thought this would eliminate prop validation errors, but I guess I don't understand that plugin properly.