-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
React Error Boundaries #8628
Comments
If your block produces an error the block will be replaced by a read-only error message à la "This block has encountered an error." or "This block has encountered an error and cannot be previewed." There's at least an |
Is the same true of other gutenberg components? E.g. from my testing with frontenberg, the div GB uses to load has no styling by default, perhaps some CSS based text that gets overriden once the JS applies classes would help alleviate the WSOD some are seeing with non-GB JS errors |
My understanding is that the WSOD was happening because of a race condition that stops Gutenberg from ever initialising. There's no exception to be caught when this happens. A CSS failsafe error message is an interesting idea. I'd worry that folks on slow connections would see the error message and reload the page before Gutenberg has had a chance to load, though. |
Then perhaps a placeholder of sorts would be better? To indicate that something happened or is happening. A WSOD implies a PHP error |
In #8637 I just outlined a potential use case for |
We do have a global error boundary to catch all JS errors happening in the gutenberg editor but some errors are happening "outside" the Gutenberg editor (metaboxes) so maybe |
I tested each of these incompatible plugins from @danielbachhuber's site. These specifically mention JS errors as the reason for incompatibility, but I was not able to trigger a WSOD with any of them. They definitely had broken functionality, but the editor still renders and only a few of them actually display errors in the console. I assume this is because many of the errors are being caught and suppressed. If we knew of an existing plugin that reliably triggered a WSOD, I think we could work out a solution faster. |
Closing in favor of #8637, which has a specific proposed implementation. |
Are react error boundaries in use? What is the expected result if I build a GB block that has a fatal error in it?
The text was updated successfully, but these errors were encountered: