WordPress / gutenberg

The Block Editor project for WordPress and beyond. Plugin is available from the official repository.
https://wordpress.org/gutenberg/
Other
10.58k stars 4.23k forks source link

White Screen of WTF just happened #2410

Closed aaronjorbin closed 7 years ago

aaronjorbin commented 7 years ago

Gutenberg 0.8 Chrome 60.0.3112.90

I clicked on the plus sign below the content and suddenly everything went away. Here is the error in my console:

https://cloudup.com/cWzWPHcgv_4

This caused me to lose content 😢

Where did my content go and why did Gutenberg go away?

karmatosed commented 7 years ago

Crumbs that isn't good. I am not getting it using the latest version. I do wonder if it could be related to an issue where pull quotes were white screening. @youknowriad - sorry to ping but wondering if you can shed some light here?

aaronjorbin commented 7 years ago

We should also consider how to:

1) Ensure there are quality error messages and stack traces, especially while we are in active development. This may mean not minifying the code. 2) How do we ensure this never happens, even after developers extend Gutenberg?

aduth commented 7 years ago

2267 can serve as an example of capturing and recovering from runtime errors, specifically those occurring in React component using new error handling features included in React 16.

I think we need to be more liberal with how we apply this pattern, and further perhaps with catching errors generally.

In a worst case, we could have a copy of the post state persisted in a local cache (indexedDB, localStorage) and recover from this when revisiting the editor.

aduth commented 7 years ago

Are you able to reproduce this issue consistently?

aaronjorbin commented 7 years ago

In a worst case, we could have a copy of the post state persisted in a local cache (indexedDB, localStorage) and recover from this when revisiting the editor.

This is something we should no matter what. If Gutenberg ends up in core, not having this would be a regression over the current editor.

aaronjorbin commented 7 years ago

Are you able to reproduce this issue consistently?

I'm not, but I only spent a few moments trying to do so thus far. It has happened to me once or twice before though.

aduth commented 7 years ago

The first error is from the Grammarly extension. Might be an incompatibility.

mtias commented 7 years ago

For reference, core pushes posts to sessionStorage (not localStorage) as wp-autosave-{x}: https://core.trac.wordpress.org/browser/trunk/src/wp-includes/js/autosave.js#L144

aaronjorbin commented 7 years ago

I noted another issue where Gutenberg was having a problem with Grammarly in #2113. The extension was also brought up in #1698.

karmatosed commented 7 years ago

I think we can close this? Going to cautiously do that :) If that's not the case, lets reopen.