Skip to content

Multiple BlockNote mounted editors cause flushSync errors #1618

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

Open
1 task done
RobinClowers opened this issue Apr 18, 2025 · 4 comments · May be fixed by #1726
Open
1 task done

Multiple BlockNote mounted editors cause flushSync errors #1618

RobinClowers opened this issue Apr 18, 2025 · 4 comments · May be fixed by #1726
Labels
bug Something isn't working

Comments

@RobinClowers
Copy link
Contributor

RobinClowers commented Apr 18, 2025

Describe the bug
When multiple editors are mounted at once, they throw flushSync errors.

flushSync was called from inside a lifecycle method. React cannot flush when React is already rendering. Consider moving this call to a scheduler task or micro task.

Similar to #1513.

To Reproduce
@edwandr helpfully created this minimal example that shows the issue. Load the page and then check the browser console.

I've forked the original reproduction and updated the dependencies to react 19 and blocknote 0.31.1.

Misc

  • Node version: 22.13.0
  • Package manager: Bun 1.2.1
  • Browser: Firefox 137
  • I'm a sponsor and would appreciate if you could look into this sooner than later 💖
@RobinClowers RobinClowers added the bug Something isn't working label Apr 18, 2025
@YousefED
Copy link
Collaborator

@RobinClowers we can look into this - I thought it only occured in niche cases. As which organization are you sponsoring?

@RobinClowers
Copy link
Contributor Author

@YousefED Thanks! I work at Poggio.

@YousefED
Copy link
Collaborator

Thanks @RobinClowers . Can you still reproduce it? Atm I don't get this error in the example you provided (tried chrome and firefox)

@RobinClowers
Copy link
Contributor Author

Oh sorry about that! I didn't realize the original example was on react 18. I've forked it and updated to the latest blocknote and react 19, and I see the errors now. https://stackblitz.com/edit/github-5zwbkwwx-eoojpbaq. Thanks again for looking into this and let me know if there is anything else I can provide.

@YousefED YousefED linked a pull request May 29, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants