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

Endless loading trying to update block registry #188

Open
PetterEck opened this issue Mar 28, 2023 · 0 comments
Open

Endless loading trying to update block registry #188

PetterEck opened this issue Mar 28, 2023 · 0 comments

Comments

@PetterEck
Copy link

I have noticed that in some of my environments, I sometimes get stuck waiting forever for the registry of blocks to go through. After some debugging, I have noticed that this happens when the heartbeat triggers after page load, meaning that while the timeout is cancelled, the registration step never starts. This seems to happen on low-end systems or otherwise slow environments such as my testing rig. Unfortunately, I don't have a foolproof way of reproducing as it seems to be very environment-dependent.

But I can fix the issue by adding an extra page load dispatch in my Gutenberg build or simply modifying the plugin in the admin.js file like so:

case actions.GET_BLOCK_REGISTRY:
	if (document.readyState === 'complete') {
		onComplete( getBlockRegistry() );
	} else {
		window.addEventListener('load', function() {
			onComplete( getBlockRegistry() );
		});
	}
	break;

It could also have to do with the load order of my environment, but I have not been able to find a way of fixing this issue in this way yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant