Error in preact-custom-element.esm.js Module parse failed: Cannot read properties of null (reading 'name')

44 Views Asked by At

I try to build web component using preact custom element, below is my code

import register from 'preact-custom-element';

function PreactComponent() {
  return (<p>Hello!</p>)
}
register(PreactComponent, 'x-greeting'); 

getting below error when try to build code

ERROR in ./node_modules/preact-custom-element/dist/preact-custom-element.esm.js Module parse failed: Cannot read properties of null (reading 'name') You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders TypeError: Cannot read properties of null (reading 'name')

I am trying to creating web component, what loader needed to build this file

0

There are 0 best solutions below