resolve "Can't find a Block to remove" error in renderFromHTML#2941
Merged
neSpecc merged 2 commits intocodex-team:nextfrom Sep 6, 2025
Merged
resolve "Can't find a Block to remove" error in renderFromHTML#2941neSpecc merged 2 commits intocodex-team:nextfrom
neSpecc merged 2 commits intocodex-team:nextfrom
Conversation
- 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
neSpecc
approved these changes
Jul 7, 2025
VolgaIgor
pushed a commit
to VolgaIgor/editor.js
that referenced
this pull request
Nov 11, 2025
…-team#2941) * fix(blocks):Error occurred when calling renderFromHTML: Can't find a Block to remove. * 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 codex-team#2518
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fix: resolve "Can't find a Block to remove" error in renderFromHTML
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