Closed zasuh closed 6 months ago
Even tried using the example code from the docs and still having this issue
const innerRef = useRef<MDXEditorMethods>(null);
<MDXEditor
ref={innerRef}
markdown="hello world"
onChange={console.log} />
Also tried using dynamic imports, same issue
const MDXEditor = dynamic(() => import('@mdxeditor/editor').then((mod) => mod.MDXEditor), {
ssr: false,
});
Not sure I follow what you describe. Is this some sort of a regression? Did the error appear after an upgrade? What's different than https://github.com/mdx-editor/mdx-editor-in-next-pages?
The error appeared after upgrading to v2. The only difference between your example and mine is that you are using server components and I'm not, also I'm on pages router.
I have created two sample repos, one with app router and one with pages router. The one I linked specifically is using the pages router. Can you fork it and reproduce the problem there? I'm not going to be able to help you otherwise.
Same problem when i am running https://github.com/mdx-editor/mdx-editor-in-cra this example on @nx/react app, client side using "@mdxeditor/editor": "2.18.0" version and same example working with this version on cra app
@Debnathweb I'm afraid that I don't understand what you mean, nor I can help without being able to reproduce the problem on my side. Since I have not heard back from @zasuh I'm closing this.
i will create a reproduction today
this error solved for me, I think this was happening because lexical was in the dependencies on my nx repo, tried other things, but after removing all lexical packages its solved.
Describe the bug I'm using MDX Editor with Next.js (Pages router) and get the following error in my browser when simply trying to render the editor. Not using any styling or anything else, just trying to render the editor in a component. I've added the necessary code into next config, but it didn't resolve the issue.
Error: Unable to find an active editor state. State helpers or node methods can only be used synchronously during the callback of editor.update() or editorState.read().
Reproduction
To Reproduce
Expected behavior I expect the editor to work as it did before and not crash the page when clicking inside the input.
Screenshots
Desktop (please complete the following information):
Additional context