Automattic / wp-calypso

The JavaScript and API powered WordPress.com
https://developer.wordpress.com
GNU General Public License v2.0
12.41k stars 1.98k forks source link

AT: Gutenberg plugin causing `The editor has encountered an unexpected error` #55685

Closed Nic-Sevic closed 2 years ago

Nic-Sevic commented 3 years ago

Steps to Reproduce

I'm not really sure how to lay out steps for this. We've have at least 2 cases where users are having the editor crash when trying to edit any post or page. Both have tried clearing cache, different browsers, and creating new pages all with the same result. HEs have not been able to duplicate the results but it happens for the users consistently.

One 4216726-zd-woothemes reported that this is only happening on online or Desktop App but that Mobile app works with no problem.

For both users the issue was resolved when they disabled Gutenberg 11.3.0. Theme switches and turning off all other plugins had no effect.

What I expected to happen

They should be able to edit pages and if they can't we should be able to reproduce the error

What actually happened

everything looks fine from our end but consistently crashes on theirs

Context

4216726-zd-woothemes 4233304-zd-woothemes

AT req: p9F6qB-7jw-p2

possibly related issue? https://github.com/Automattic/wp-calypso/issues/55628

Operating System

Windows, macOS

OS Version

No response

Browser

Chrome/Chromium, Firefox, Safari

Browser Version(s)

No response

Is this specific to applied theme? If so, what is the theme name?

No response

Simple/Atomic

No response

Console and/or error logs

TypeError: Cannot read property \'defaults\' of undefined at Object.wp.media (https://c0.wp.com/c/5.8/wp-includes/js/media-models.min.js:2:8188) at new m (https://kafaak.blog/wp-content/plugins/gutenberg/build/media-utils/index.min.js?ver=e333492b8b7f4e29223a9bd82e4b8cb8:1:3927) at fh (https://kafaak.blog/wp-content/plugins/gutenberg/vendor/react-dom.min.edd8b7a6.js:81:106) at Ch (https://kafaak.blog/wp-content/plugins/gutenberg/vendor/react-dom.min.edd8b7a6.js:114:51) at Pj (https://kafaak.blog/wp-content/plugins/gutenberg/vendor/react-dom.min.edd8b7a6.js:233:139) at di (https://kafaak.blog/wp-content/plugins/gutenberg/vendor/react-dom.min.edd8b7a6.js:168:305) at Nj (https://kafaak.blog/wp-content/plugins/gutenberg/vendor/react-dom.min.edd8b7a6.js:168:236) at sc (https://kafaak.blog/wp-content/plugins/gutenberg/vendor/react-dom.min.edd8b7a6.js:168:96) at gf (https://kafaak.blog/wp-content/plugins/gutenberg/vendor/react-dom.min.edd8b7a6.js:162:109) at https://kafaak.blog/wp-content/plugins/gutenberg/vendor/react-dom.min.edd8b7a6.js:73:230

and

TypeError: Cannot read property 'indexOf' of undefined at u (https://mynintendonews.com/wp-content/plugins/autodescription/lib/js/pt-gb.min.js?ver=4.1.4:1:755) at Object.initSelectors (https://mynintendonews.com/wp-content/plugins/autodescription/lib/js/pt-gb.min.js?ver=4.1.4:1:3146) at Object.render (https://mynintendonews.com/wp-content/plugins/autodescription/lib/js/pt-gb.min.js?ver=4.1.4:1:3259) at Te (https://mynintendonews.com/wp-content/plugins/gutenberg/vendor/react-dom.min.edd8b7a6.js:119:308) at Ch (https://mynintendonews.com/wp-content/plugins/gutenberg/vendor/react-dom.min.edd8b7a6.js:119:105) at Pj (https://mynintendonews.com/wp-content/plugins/gutenberg/vendor/react-dom.min.edd8b7a6.js:233:139) at di (https://mynintendonews.com/wp-content/plugins/gutenberg/vendor/react-dom.min.edd8b7a6.js:168:305) at Nj (https://mynintendonews.com/wp-content/plugins/gutenberg/vendor/react-dom.min.edd8b7a6.js:168:236) at sc (https://mynintendonews.com/wp-content/plugins/gutenberg/vendor/react-dom.min.edd8b7a6.js:168:96) at gf (https://mynintendonews.com/wp-content/plugins/gutenberg/vendor/react-dom.min.edd8b7a6.js:162:109)

Number of Users Impacted

No response

Available Workarounds

disable Gutenberg

Reproducibility

No response

Other information

No response

retnonindya commented 3 years ago

I think I got the same reports too.

Both sites are AT, and both have Gutenberg plugin active. Unfortunately:

... So I can't confirm with them.

I deactivated Gutenberg and I'm going to check with them again.

Robertght commented 3 years ago

Thank you both for flagging this. I added this for Flow Patrol Manage for now.

sixhours commented 3 years ago

One of the console errors in the original report suggests a plugin may still be active because it includes the plugin directory /wp-content/plugins/autodescription/, so that's something to try for that user; make sure all plugins are deactivated.

I'm not able to reproduce this on my Atomic test site in:

Mac 11.5.2 / Firefox 91 Mac 11.5.2 / Safari 14.1.2 Mac 11.5.2 / Chrome 92

Windows 10 / Edge latest Windows 10 / Chrome 92

Googling seems to suggest this error is usually caused by a plugin conflict. I'm going to see if I can do some debugging on the user's site itself and see where it goes.

sixhours commented 3 years ago

Checked out one of the users' sites and tried to reproduce the issue by activating all the same plugins and theme, but no dice. Obviously there are a lot of variables here, so short of an affected site letting us go in and play around with the site settings to recreate and debug it, there's not much we can do.

Robertght commented 3 years ago

@sixhours I agree. I remember a similar case with the autodescription plugin previously and turning that off fixed the issue. this appears to be fixed here by the plugin author:

https://wordpress.org/support/topic/wordpress-com-business-plugin-causing-error-when-editing-post/

@Nic-Sevic @retnonindya can you double-check this as well with your users, please?

kdevnel commented 3 years ago

I've replied to @Nic-Sevic user here - 4233304-zd-woothemes - I've provided an explanation around this that disabling Gutenberg isn't likely to be a good long-term solution but rather doing local plugin/theme/custom code conflict testing is best so developers can improve their plugins and fix issues that will likely be introduced into the core editor eventually anyway.

jp-imagines commented 3 years ago

Another report in 31544152-hc. Wasn't able to replicate myself, but disabling Gutenberg resolved the issue for the user. Only two non-default plugins installed on this site (and a retired WPcom theme active).

cuemarie commented 3 years ago

Another report here: 29151076-hc Strongly recommended they perform a full theme/plugin conflict test, however deactivating Gutenberg allowed them access for now.

edwinho89 commented 3 years ago

Another report: 31550917-hc Clearing browser cache did not help

Robertght commented 3 years ago

@cuemarie I can see a lot of error messages in the browser console with Gutenberg active. I can see some of them are not Gutenberg-related, but it's worth making sure this isn't a theme issue as well.

In this case, Yoast and Gutenberg Blocks – PublishPress Blocks Gutenberg Editor plugin errors is something I could see problematic.

@edwinho89 - the only see I see in common here is Gutenberg Blocks – PublishPress Blocks Gutenberg Editor(advanced-gutenberg). Can you check with the user to see if they could turn off this plugin?

synora commented 3 years ago

Another report: 31705921-hc. Deactivating Gutenberg solved the issue. I also suggested they do conflict troubleshooting with plugins.

ClassicRKR27 commented 3 years ago

Another report here: 31709810-hc

Deactivating Gutenberg also solved the issue here.

ClassicRKR27 commented 3 years ago

Another report here were deactivating Gutenberg solved the issue: 31562888-hc

Sandkorner commented 3 years ago

ZEN-4309308 Seems to be the same issue, but we activated classic editor and it seemed to work as well.

edwinho89 commented 3 years ago

Another issue in 31388064-hc

With latest Gutenberg plugin v11.5, when attempting to bulk select images and switch to carousel block on a draft post, it resulted in an error and populates the following error message:

Error: Failed to execute 'removeChild' on 'Node': The node to be removed is not a child of this node.
    at Sh (https://joshatthemovies.com/wp-content/plugins/gutenberg/vendor/react-dom.min.edd8b7a6.js:152:147)
    at Rh (https://joshatthemovies.com/wp-content/plugins/gutenberg/vendor/react-dom.min.edd8b7a6.js:148:115)
    at Sh (https://joshatthemovies.com/wp-content/plugins/gutenberg/vendor/react-dom.min.edd8b7a6.js:151:394)
    at Qj (https://joshatthemovies.com/wp-content/plugins/gutenberg/vendor/react-dom.min.edd8b7a6.js:174:181)
    at unstable_runWithPriority (https://joshatthemovies.com/wp-content/plugins/gutenberg/vendor/react.min.755b0ae9.js:24:26)
    at Za (https://joshatthemovies.com/wp-content/plugins/gutenberg/vendor/react-dom.min.edd8b7a6.js:73:8)
    at eb (https://joshatthemovies.com/wp-content/plugins/gutenberg/vendor/react-dom.min.edd8b7a6.js:170:163)
    at gf (https://joshatthemovies.com/wp-content/plugins/gutenberg/vendor/react-dom.min.edd8b7a6.js:162:317)
    at https://joshatthemovies.com/wp-content/plugins/gutenberg/vendor/react-dom.min.edd8b7a6.js:73:230
    at unstable_runWithPriority (https://joshatthemovies.com/wp-content/plugins/gutenberg/vendor/react.min.755b0ae9.js:24:26)
Gustavo-Hilario commented 3 years ago

Another report here 4315236-zen

Deactivating Gutenberg also solved the issue here.

katiebethbrown commented 3 years ago

I did some conflict testing for this case - https://github.com/Automattic/wp-calypso/issues/55685#issuecomment-924393757

It only seems to occur when all of these plugins are active:

Deactivating any one of the those allows the editor to load.

The same combination of plugins on my test site does not repro the error though, so it's seems like there's more at play.

The error from the editor is as follows:

p@https://cambashi.com/wp-content/plugins/full-site-editing/wpcom-block-editor-nux/dist/wpcom-block-editor-nux.js?ver=c7099b471ce4ea63e87ec41253cabfc8:6:36393
2753/t.Z/<@https://cambashi.com/wp-content/plugins/full-site-editing/wpcom-block-editor-nux/dist/wpcom-block-editor-nux.js?ver=c7099b471ce4ea63e87ec41253cabfc8:6:34985
Tj@https://cambashi.com/wp-content/plugins/gutenberg/vendor/react-dom.min.edd8b7a6.js:179:399
unstable_runWithPriority@https://cambashi.com/wp-content/plugins/gutenberg/vendor/react.min.755b0ae9.js:24:26
Za@https://cambashi.com/wp-content/plugins/gutenberg/vendor/react-dom.min.edd8b7a6.js:73:8
Ra@https://cambashi.com/wp-content/plugins/gutenberg/vendor/react-dom.min.edd8b7a6.js:178:368
gf@https://cambashi.com/wp-content/plugins/gutenberg/vendor/react-dom.min.edd8b7a6.js:161:497
$g/<@https://cambashi.com/wp-content/plugins/gutenberg/vendor/react-dom.min.edd8b7a6.js:73:230
unstable_runWithPriority@https://cambashi.com/wp-content/plugins/gutenberg/vendor/react.min.755b0ae9.js:24:26
Za@https://cambashi.com/wp-content/plugins/gutenberg/vendor/react-dom.min.edd8b7a6.js:73:8
$g@https://cambashi.com/wp-content/plugins/gutenberg/vendor/react-dom.min.edd8b7a6.js:73:178
ja@https://cambashi.com/wp-content/plugins/gutenberg/vendor/react-dom.min.edd8b7a6.js:73:111
Pa@https://cambashi.com/wp-content/plugins/gutenberg/vendor/react-dom.min.edd8b7a6.js:157:212
Me@https://cambashi.com/wp-content/plugins/gutenberg/vendor/react-dom.min.edd8b7a6.js:110:252
e@https://cambashi.com/wp-content/plugins/gutenberg/build/data/index.min.js?ver=da4272fbc833ab25871c55f89400d555:1:19841
t@https://cambashi.com/wp-content/plugins/gutenberg/build/data/index.min.js?ver=da4272fbc833ab25871c55f89400d555:1:19908
c/t.subscribe/o<@https://cambashi.com/wp-content/plugins/gutenberg/build/data/index.min.js?ver=da4272fbc833ab25871c55f89400d555:1:14312
instantiate/b</<@https://cambashi.com/wp-content/plugins/gutenberg/build/data/index.min.js?ver=da4272fbc833ab25871c55f89400d555:1:13434
y@https://cambashi.com/wp-content/plugins/gutenberg/build/data/index.min.js?ver=da4272fbc833ab25871c55f89400d555:1:6847
instantiate/c</</</<@https://cambashi.com/wp-content/plugins/gutenberg/build/data/index.min.js?ver=da4272fbc833ab25871c55f89400d555:1:10995
o/</</<@https://cambashi.com/wp-content/plugins/gutenberg/build/redux-routine/index.min.js?ver=7a21a7d0e50a3686a159176880d88a37:1:8566
A/</<@https://cambashi.com/wp-content/plugins/gutenberg/build/data/index.min.js?ver=da4272fbc833ab25871c55f89400d555:1:8792
P/</</<@https://cambashi.com/wp-content/plugins/gutenberg/build/data/index.min.js?ver=da4272fbc833ab25871c55f89400d555:1:9138
instantiate/f</</<@http
<img width="1418" alt="Screen Shot 2021-09-23 at 6 10 09 PM" src="https://user-images.githubusercontent.com/42279181/134599508-1428d451-1f1b-44a6-9807-d2161741af88.png">
s://cambashi.com/wp-content/plugins/gutenberg/build/data/index.min.js?ver=da4272fbc833ab25871c55f89400d555:1:11684
pt/<@https://cambashi.com/wp-content/plugins/gutenberg/build/core-data/index.min.js?ver=1af353c8c89d564116df2f82c98692e7:1:30970
sixhours commented 3 years ago

Another issue in 31388064-hc

With latest Gutenberg plugin v11.5, when attempting to bulk select images and switch to carousel block on a draft post, it resulted in an error and populates the following error message:

Error: Failed to execute 'removeChild' on 'Node': The node to be removed is not a child of this node.
    at Sh (https://joshatthemovies.com/wp-content/plugins/gutenberg/vendor/react-dom.min.edd8b7a6.js:152:147)
    at Rh (https://joshatthemovies.com/wp-content/plugins/gutenberg/vendor/react-dom.min.edd8b7a6.js:148:115)
    at Sh (https://joshatthemovies.com/wp-content/plugins/gutenberg/vendor/react-dom.min.edd8b7a6.js:151:394)
    at Qj (https://joshatthemovies.com/wp-content/plugins/gutenberg/vendor/react-dom.min.edd8b7a6.js:174:181)
    at unstable_runWithPriority (https://joshatthemovies.com/wp-content/plugins/gutenberg/vendor/react.min.755b0ae9.js:24:26)
    at Za (https://joshatthemovies.com/wp-content/plugins/gutenberg/vendor/react-dom.min.edd8b7a6.js:73:8)
    at eb (https://joshatthemovies.com/wp-content/plugins/gutenberg/vendor/react-dom.min.edd8b7a6.js:170:163)
    at gf (https://joshatthemovies.com/wp-content/plugins/gutenberg/vendor/react-dom.min.edd8b7a6.js:162:317)
    at https://joshatthemovies.com/wp-content/plugins/gutenberg/vendor/react-dom.min.edd8b7a6.js:73:230
    at unstable_runWithPriority (https://joshatthemovies.com/wp-content/plugins/gutenberg/vendor/react.min.755b0ae9.js:24:26)

@edwinho89 I'm able to reproduce this on my test site, too, although I don't think it's related to this particular issue since it's not throwing a similar error message. In testing it appears to be specific to CoBlocks so may need to be reported to them. Could you create a new issue with more details so it can be triaged separately? Thank you!

sixhours commented 3 years ago

@synora @ClassicRKR27 @Gustavo-Hilario @Sandkorner Hi folks! The best next step is to check to see if the users have other active plugins or themes that are causing a conflict. PublishPress Blocks may be a culprit, as noted by Robert here: https://github.com/Automattic/wp-calypso/issues/55685#issuecomment-915023772

If you've ruled out a theme/plugin conflict, we need more details about the users' setups to try to reproduce the issue and debug it further. Devs don't have access to ZD to see ticket details. Thank you!

Gustavo-Hilario commented 3 years ago

4315236

The user here is using all plugins mentioned by @katiebethbrown :

  1. Gutenberg
  2. WPcom Toolkit
  3. Ultimate Addons for Gutenberg
  4. PublishPress Blocks
daria2303 commented 3 years ago

4335718-zd-woothemes Using only Akismet, AMP, Gutenberg, Embed Plus for YouTube, Jetpack

ClassicRKR27 commented 3 years ago

Another report here with Firefox: 4342066-zd-woothemes

This case was a bit more interesting because while disabling Gutenberg did ultimately resolve the issue, they were getting this error message in Firefox that I haven't seen before: https://snipboard.io/enuCSa.jpg

I was unable to replicate the issue in my version of Firefox and there are a lot of CLI notices coming from Varia with the Shawburn theme installed.

sixhours commented 2 years ago

Since we can't consistently reproduce this, I'm inclined to close this and chalk it up to conflicts with non-Automattic plugins (PublishPress Blocks, for example) and Gutenberg; in these cases, the fix is to stop using the conflicting plugin, or deactivate Gutenberg.

sixhours commented 2 years ago

Closing this out since we haven't been able to consistently reproduce it. Happiness folks, if you encounter this issue, make sure to rule out all third-party plugins (ask the user to disable them).