Element type is invalid. Received a promise that resolves to: [object Object]. Lazy element type must resolve to a class or function - SunEditor

1.4k views Asked by At

this is mycomponent.js file under pages folder in Next.js

import dynamic from "next/dynamic";
import 'suneditor/dist/css/suneditor.min.css'; // Import Sun Editor's CSS File

const SunEditor = dynamic(() => import("suneditor-react"), {
  ssr: false,
});

const MyComponent = props => {
  return (
    <div>
      <p> My Other Contents </p>
      <SunEditor />
    </div>
  );
};
export default MyComponent;

I have copied this code from npm website https://www.npmjs.com/package/suneditor-react into my Next.js App.

Element type is invalid. Received a promise that resolves to: [object Object]. Lazy element type must resolve to a class or function at page http://localhost:3000/mycomponent

0

There are 0 answers