-
Notifications
You must be signed in to change notification settings - Fork 812
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
Converting a VideoPress block to regular video causes the block to crash #39417
Converting a VideoPress block to regular video causes the block to crash #39417
Comments
A quick note on this to add additional context, when saving the Draft and refreshing the browser, the video is displayed correctly CleanShot.2025-02-10.at.16.29.20.mp4 |
When adding a componentDidCatch( error, info ) {
console.log( error, info ); this is the error printed:
|
The error seems to be in Gutenberg editor, I have created this Draft PR to start iterating over it WordPress/gutenberg#69152 |
I have moved the linked PR WordPress/gutenberg#69152 to |
After some investigation, I have found that this is done when applying this filter (that functionality was added as part of #26799). That code is called by this Gutenberg code. So if we remove the |
A new occurrence of the same error has been reproduced when selecting the Error logged in Developer Consolereact-dom.min.js?ver=18:1 TypeError: Cannot read properties of undefined (reading 'ownerDocument') at bm (wp-block-editor-20.0.0-hotfix.min.js?ver=8bc2927f2c02c2cae6c4:36:19625) at computeStyle (wp-block-editor-20.0.0-hotfix.min.js?ver=8bc2927f2c02c2cae6c4:36:20211) at wp-block-editor-20.0.0-hotfix.min.js?ver=8bc2927f2c02c2cae6c4:36:19119 at Object.wt [as useReducer] (react-dom.min.js?ver=18:1:46943) at e.useReducer (react.min.js?ver=18:1:9954) CleanShot.2025-02-19.at.17.14.44.mp4 |
I'm not familiar with Jetpack's codebase, but the error appears to occur when generating the preview. I may be missing something, but is it because the component generating the preview doesn't have |
Hi @t-hamano, thanks for your suggestion, it makes sense so I have gone ahead and tested it. I have wrapped this component to use |
It's a shame the issue didn't get fixed, but we really need to determine if the problem is with the Gutenberg plugin. WordPress/gutenberg#69152 addresses the scenario of an undefined I think Jetpack overrides the One thing that bothers me is that there is a conditional statement in the |
I agree, there seems to be something in this code causing the
Yes, after the latest investigations, I think the problem is caused by the overrides. A quick note on that is that the I will investigate your suggestions 👀 |
@t-hamano, I have found the code that is causing the However, it seems to me that the issue in Gutenberg is a race condition in the update of |
I'm concerned that this will suppress errors that should be notified to developers, which may increase the possibility that users will extend core blocks in incorrect ways. I would recommend further investigation into the following points:
|
Impacted plugin
VideoPress
Quick summary
When a VideoPress block is converted to regular video, the block crashes, showing this message:
This block has encountered an error and cannot be previewed.
Kapture.2024-09-17.at.10.24.41.mp4
Steps to reproduce
This block has encountered an error and cannot be previewed.
A clear and concise description of what you expected to happen.
It should be possible to go back and forth between the to blocks. If this is not possible for technical reasons, The VideoPress block should not offer the option to convert back to regular video to avoid this error.
What actually happened
The block crashes.
Impact
All
Available workarounds?
Yes, easy to implement
If the above answer is "Yes...", outline the workaround.
The crashed video block CAN be converted back into a VideoPress block but the scenarios is still confusing to users.
Platform (Simple and/or Atomic)
Simple, Atomic
Logs or notes
This is happening on Simple, Atomic, and self-hosted.
The text was updated successfully, but these errors were encountered: