[lexical-clipboard] Bug Fix: Log exceptions in clipboard paste handler#7942
Merged
etrepum merged 4 commits intofacebook:mainfrom Oct 23, 2025
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
etrepum
reviewed
Oct 23, 2025
Collaborator
etrepum
left a comment
There was a problem hiding this comment.
The error handling elsewhere uses console.error rather than console.log
etrepum
approved these changes
Oct 23, 2025
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.
This PR fixes issue #7940 where exceptions thrown during HTML paste operations were silently swallowed, making it impossible for developers to debug import handlers.
Current behavior: When an error occurs in custom HTML import handlers (e.g., html.import.span), the exception is caught in clipboard.ts but never displayed or logged. Developers have no visibility into why paste operations fail or behave unexpectedly.
Changes made: Modified the error handling in @lexical/clipboard to properly log exceptions during HTML paste operations. The exceptions are now surfaced to the console with full stack traces, allowing developers to identify and fix issues in their custom import handlers.
The fix ensures that while paste operations remain stable in production, developers get the diagnostic information they need during development and debugging.
Closes #7940
Test plan
After