Making WordPress.org

Opened 8 years ago

Closed 8 years ago

#3735 closed defect (bug) (fixed)

Frontenberg broken on Rosetta websites: Block "core/shortcode" is not registered.

Reported by: audrasjb Owned by:
Priority: normal Milestone:
Component: International Sites (Rosetta) Keywords:
Cc:

Description

Hello,

Hello, fronteberg seems to be broken.
This error appear in browser console: Block "core/shortcode" is not registered.
Examples:

Change History (8)

#1 @audrasjb
8 years ago

  • Priority highest omg bbqnormal

The issue seems to be fixed now, thanks :)

#2 @netweb
8 years ago

  • Resolutionfixed
  • Status newclosed

This ticket was mentioned in Slack in #meta by garrett-eclipse. View the logs.


8 years ago

#4 @garrett-eclipse
8 years ago

  • Resolution fixed
  • Status closedreopened

This issue continues to persist and seems to be a RACE condition so doesn't always surface

#5 @aduth
8 years ago

Still seeing this happen as of today, August 3, 2018.

I commented in Slack with a suspected cause.

The white screen is caused by this line: https://meta.trac.wordpress.org/browser/sites/trunk/wordpress.org/public_html/wp-content/themes/pub/gutenberg/functions.php?rev=7584#L158
Probably a race condition with the initialization of the editor, which is slightly more involved https://github.com/WordPress/gutenberg/blob/9ae5aa223ef80c48f2352e4b90ffaefc37bc5258/lib/client-assets.php#L1292-L1298
Instead of wp.domReady, it should probably be using window._wpLoadGutenbergEditor.then

Edit: To clarify, the race condition is that it is initializeEditor which registers the core set of blocks:

https://github.com/WordPress/gutenberg/blob/9ae5aa223ef80c48f2352e4b90ffaefc37bc5258/edit-post/index.js#L70

I suspect that what is happening is that the wp.api.init in Gutenberg's own initialization is slightly more delayed than the wp.domReady in the gutenberg frontend theme, so it's attempting to unregister the block before it's yet been registered.

Last edited 8 years ago by aduth (previous) (diff)

#6 @obenland
8 years ago

In 7592:

Gutenberg: Don't unregister block until after editor initialized.

Props randerson, aduth.
See #3735.

#7 @dd32
8 years ago

In 7593:

Gutenberg: Override wp.domReady with a version which doesn't contain a race-condition, this fixes the whitescreen on frontendberg on first load.

wp.domReady() is incorrectly regisering callbacks (such as the Gutenberg init function) to be fired on DOMContentLoaded AFTER that event has already fired, causing the callbacks to never run.
This replaces it with a version which does work, calling the callback immediately when document.readyState is at interactive (which is what fires DOMContentLoaded) or complete (when styles/images/etc are loaded, which the Gutenberg wp.domReady does).

See #3703, #3735.

#8 @obenland
8 years ago

  • Resolutionfixed
  • Status reopenedclosed
Note: See TracTickets for help on using tickets.