Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

In next.js 13, Error: Unable to find an active editor state #38

Open
maccomaccomaccomacco opened this issue Apr 7, 2023 · 3 comments
Open

Comments

@maccomaccomaccomacco
Copy link

Describe the bug
Trying to use Verbum in a Next.js project, I get the following error

Unhandled Runtime Error
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().

To Reproduce
Steps to reproduce the behavior:

  1. create a next.js 13 project
  2. define a component with the following code
'use client'

import {
    EditorComposer,
    Editor,
    ToolbarPlugin,
    AlignDropdown,
    InsertDropdown,
  } from 'verbum';
  
  const Verbum = () => {
    return (
      
    <EditorComposer>
        <Editor hashtagsEnables={true}>
        <ToolbarPlugin defaultFontSize="20px">
            <InsertDropdown enablePool={true} />
            <AlignDropdown />
        </ToolbarPlugin>
        </Editor>
    </EditorComposer>
    );
  };
  
  export default Verbum;
  1. import the component into src/app/page.jsx
  2. run the next.js application yarn run dev
  3. you'll get the error

Expected behavior
No error in next.js and Lexical editor rendered

Screenshots
image

Desktop (please complete the following information):

  • OS: MacOS moneterey 12.2.1
  • chrome
@reza-madani
Copy link

Describe the bug Trying to use Verbum in a Next.js project, I get the following error

Unhandled Runtime Error
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().

To Reproduce Steps to reproduce the behavior:

  1. create a next.js 13 project
  2. define a component with the following code
'use client'

import {
    EditorComposer,
    Editor,
    ToolbarPlugin,
    AlignDropdown,
    InsertDropdown,
  } from 'verbum';
  
  const Verbum = () => {
    return (
      
    <EditorComposer>
        <Editor hashtagsEnables={true}>
        <ToolbarPlugin defaultFontSize="20px">
            <InsertDropdown enablePool={true} />
            <AlignDropdown />
        </ToolbarPlugin>
        </Editor>
    </EditorComposer>
    );
  };
  
  export default Verbum;
  1. import the component into src/app/page.jsx
  2. run the next.js application yarn run dev
  3. you'll get the error

Expected behavior No error in next.js and Lexical editor rendered

Screenshots image

Desktop (please complete the following information):

  • OS: MacOS moneterey 12.2.1
  • chrome

I have same problem

@geekyayush
Copy link

Facing the same issue.
Any solution?

@geekyayush
Copy link

@marcoautiero @reza-madani
were you able to solve this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants