I want to create RichTextBox(wysiwyg) on Next.Js using SunEditor, but I am getting TypeError: core._resourcesStateChange is not a function. I do not encounter any problems when I try the same code on React.js. How can I fix this situation?
Editor Component
import React from "react";
import 'suneditor/dist/css/suneditor.min.css';
import dynamic from "next/dynamic";
const SunEditor = dynamic(() => import("suneditor-react"), {
ssr: false,
});
const TextEditor2 = props => {
return (
<div>
<SunEditor />
</div>
);
};
export default TextEditor2;
index.js
import "suneditor/dist/css/suneditor.min.css";
import styles from "../styles/Home.module.css";
import TextEditor2 from "../components/TextEditor2";
export default function Home() {
return (
<div className={styles.container}>
<TextEditor2/>
</div>
);
}

I downgraded my next version to 12.2.2 then problem is solved. I am not sure about correlation between sun editor and next version. I actually had a middleware issue and I solved it by downgraded next version then sun editor error message has gone.
https://nextjs.org/docs/advanced-features/middleware
According to link v12.2.0 Middleware is stable