Skip to content
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

Post Preview: Native preview crashes the editor (intermittent) #57128

Closed
worldomonation opened this issue Oct 18, 2021 · 3 comments
Closed

Post Preview: Native preview crashes the editor (intermittent) #57128

worldomonation opened this issue Oct 18, 2021 · 3 comments
Labels
[Closed] Fixed Issues explicitly fixed with PRs. Do not use for no longer reproducible issues. Needs triage Ticket needs to be triaged [Pri] High Address as soon as possible after BLOCKER issues [Type] Bug When a feature is broken and / or not performing as intended

Comments

@worldomonation
Copy link
Contributor

worldomonation commented Oct 18, 2021

Quick summary

The native Gutenberg preview can crash the editor under certain circumstances.

Steps to reproduce

  1. start a new post.
  2. add title.
  3. press tab to move to the body of the post.
  4. click on Preview button.
  5. click on Mobile or Tablet.
  6. click on Desktop.

What you expected to happen

The live preview shown in the Gutenberg editor should revert to the Desktop size, which occupies the full width of the editor.

What actually happened

The editor crashes with the error: The editor has encountered an unexpected error.

Screen.Recording.2021-10-18.at.2.45.26.PM.mov
Screen.Recording.2021-10-18.at.2.33.05.PM.mov

Context

#57014

Browser

Mozilla Firefox, Microsoft Edge

Simple/Atomic

Simple, Atomic

Other notes

Console error:

TypeError: Cannot read properties of null (reading 'removeEventListener')
    at https://s0.wp.com/wp-content/plugins/gutenberg-core/v11.7.0/build/components/index.min.js?m=1634147048h&ver=325888c3acfb32b2d545dfa09574a666:1:271633
    at cf (https://s0.wp.com/wp-content/plugins/gutenberg-core/v11.7.0/vendor/react-dom.min.edd8b7a6.js?m=1624062436h:7:34620)
    at Qj (https://s0.wp.com/wp-content/plugins/gutenberg-core/v11.7.0/vendor/react-dom.min.edd8b7a6.js?m=1624062436h:8:8342)
    at unstable_runWithPriority (https://s0.wp.com/wp-content/plugins/gutenberg-core/v11.7.0/vendor/react.min.755b0ae9.js?m=1624062436h:5:3609)
    at Za (https://s0.wp.com/wp-content/plugins/gutenberg-core/v11.7.0/vendor/react-dom.min.edd8b7a6.js?m=1624062436h:6:12302)
    at eb (https://s0.wp.com/wp-content/plugins/gutenberg-core/v11.7.0/vendor/react-dom.min.edd8b7a6.js?m=1624062436h:8:6339)
    at gf (https://s0.wp.com/wp-content/plugins/gutenberg-core/v11.7.0/vendor/react-dom.min.edd8b7a6.js?m=1624062436h:8:2335)
    at https://s0.wp.com/wp-content/plugins/gutenberg-core/v11.7.0/vendor/react-dom.min.edd8b7a6.js?m=1624062436h:6:12524
    at unstable_runWithPriority (https://s0.wp.com/wp-content/plugins/gutenberg-core/v11.7.0/vendor/react.min.755b0ae9.js?m=1624062436h:5:3609)
    at Za (https://s0.wp.com/wp-content/plugins/gutenberg-core/v11.7.0/vendor/react-dom.min.edd8b7a6.js?m=1624062436h:6:12302)

Post text:

<!-- wp:quote -->
<blockquote class="wp-block-quote"><p>lwuroiweuoirweoiruwoer</p><cite>ljwelkjrlwker</cite></blockquote>
<!-- /wp:quote -->

<!-- wp:paragraph -->
<p></p>
<!-- /wp:paragraph -->

Reproducibility

Consistent

Severity

Most (> 50%)

Available workarounds?

Yes, easy to implement

Workaround details

No response

@worldomonation worldomonation added [Type] Bug When a feature is broken and / or not performing as intended Needs triage Ticket needs to be triaged [Pri] High Address as soon as possible after BLOCKER issues labels Oct 18, 2021
@worldomonation
Copy link
Contributor Author

#56980 introduced the native preview.

@chad1008
Copy link
Contributor

I'm also able to reproduce on a vanilla install locally. It looks like it was introduced when Gutenberg first started iframing mobile/tablet previews.

So it's likely this has been the core plugin for a few months, and just landed on wpcom recently when we switched over to the native preview.

I've opened an issue in the core plugin repo: WordPress/gutenberg#35807

On the WPCOM side, this conversation is related to the overall switch to native previews: p58i-bmT-p2

worldomonation added a commit that referenced this issue Oct 21, 2021
- skip the test for desktops due to known issue: #57128
- implement preview methods in GutenbergEditorPage object.
worldomonation added a commit that referenced this issue Oct 22, 2021
- skip the test for desktops due to known issue: #57128
- implement preview methods in GutenbergEditorPage object.
worldomonation added a commit that referenced this issue Oct 22, 2021
…ile device. (#57132)

* Re-add preview steps back to Editor: Basic Post:
- skip the test for desktops due to known issue: #57128
- implement preview methods in GutenbergEditorPage object.

* Update comments

* Add JSDoc and method comments.

* Move into the library implementation of `itif`.

* Use `waitForSelector` when ensuring the preview menu pane is closed.

* Skip post draft saving step if mobile.
@worldomonation
Copy link
Contributor Author

Checked that this no longer occurs after upstream issue has been fixed.

@worldomonation worldomonation added the [Closed] Fixed Issues explicitly fixed with PRs. Do not use for no longer reproducible issues. label Nov 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Closed] Fixed Issues explicitly fixed with PRs. Do not use for no longer reproducible issues. Needs triage Ticket needs to be triaged [Pri] High Address as soon as possible after BLOCKER issues [Type] Bug When a feature is broken and / or not performing as intended
Projects
None yet
Development

No branches or pull requests

2 participants