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.

Bundle problem -Custom component undefined !

See original GitHub issue

admin-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:closed
  • Created 3 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
SimonB407commented, Jan 26, 2021

This path AdminBro.bundle("../../src/photo") and this path import 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.

0reactions
dzirafcommented, Dec 28, 2021

Closing because the issue is old. If you still need help, please reopen.

Read more comments on GitHub >

github_iconTop 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 >

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