Unable to use custom Componets in AdminBro

Viewed 925

I am using admin-bro with express js and everything seemed to me be working fine until I tried to add custom component to change an input field of a resource. Following is the code I am using.

EditLogoField.jsx

const React = require('react');

class EditLogoField extends React.PureComponent {
   render() {
     return (
       <input type='file'/>
     );
   }
}
 module.exports = EditLogoField;

I am trying to use it like this

const AdminBro = require('admin-bro');

module.exports = {
  properties: {
    logo: {
      type: 'string',
      isVisible: {
        list: false,
        edit: true,
        filter: false,
        show: true,
      },
      components: {
        edit: AdminBro.bundle('../components/serviceProviderCompany/EditLogoField')
      }
    },
  },
};

All I get is this

enter image description here

1 Answers

Had the same issue. Spent whole day trying to solve it. Build failed on both Windows and Ubuntu systems. My path to the project folder had a '.' symbol in it 'C:\.code\Projects' which also caused recently some issues with Unity project.

Solution:

move project into a folder that doesn't have a '.' symbol in its path.
Related