Skip to content

resolve "Can't find a Block to remove" error in renderFromHTML #2941

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
wants to merge 2 commits into
base: next
Choose a base branch
from

Conversation

narpat-ps
Copy link

fix: resolve "Can't find a Block to remove" error in renderFromHTML

  • Make renderFromHTML async and await BlockManager.clear() to prevent race condition
  • Change removeBlock order: remove from array before destroy to prevent index invalidation
  • Fix clear() method to copy blocks array before iteration to avoid modification during loop

Fixes issue where renderFromHTML would fail with "Can't find a Block to remove" error
due to concurrent block removal operations and array modification during iteration.

Resolves #2518

- Make renderFromHTML async and await BlockManager.clear() to prevent race condition
- Change removeBlock order: remove from array before destroy to prevent index invalidation
- Fix clear() method to copy blocks array before iteration to avoid modification during loop

Fixes issue where renderFromHTML would fail with "Can't find a Block to remove" error
due to concurrent block removal operations and array modification during iteration.

Resolves codex-team#2518
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

Successfully merging this pull request may close these issues.

Error occurred when calling renderFromHTML: Can't find a Block to remove.
1 participant