Bundle problem -Custom component undefined !
See original GitHub issueadmin-bro 3.3.1 i try to build custom component : in the options:
const options = {
properties: {
photo: {
components: {
edit: AdminBro.bundle("../../src/photo"),//the path is right !
},
},
},
};
the photo edit componenet:
import React from "react";
const Edit = () => {
return <div>hello</div>;
};
export default Edit;
and the created entry of admin bro:
AdminBro.UserComponents = {}
import Component1 from '../controllers/resources/photo'
AdminBro.UserComponents.Component1 = Component1
i dont know why i get:
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's defined in, or you might have mixed up default and named imports. Check the render method of `BasePropertyComponent`.
See development console for more details…
.
react_devtools_backend.js:2430 Warning: React.createElement: 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 BasePropertyComponent
…
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (2 by maintainers)
Top Results From Across the Web
Error using a custom component · Issue #255 - GitHub
I am trying to get a custom component to work. ... Error. The 'this' keyword is equivalent to 'undefined' at the top level...
Read more >webpack build of react component plugin - Stack Overflow
But I get the error message, TypeError: Cannot read property 'Component' of undefined . Clearly I am doing something wrong with my webpack ......
Read more >Custom Lightning Component does not appear in Community ...
Recreating the Custom Component by copying the Aura Bundle code into a new set of bundles in the full sandbox. This also failed...
Read more >uncaught error: cannot create styled-component for ... - You.com
I get the Cannot create styled-component for component: undefined error when I try to instantiate the ServerStyleSheet but it works fine without it....
Read more >Deal with Undefined 'this' in React Event Handlers Correctly
But here's the interesting thing: it's not running into the error that comes ... If you've worked with React, you've probably written a...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
This path
AdminBro.bundle("../../src/photo")
and this pathimport Component1 from '../controllers/resources/photo'
are different. Either you copied this code in different times and meanwhile you did some change, or something is not right. You can try and delete .admin-bro directory.Closing because the issue is old. If you still need help, please reopen.