PLANET-7565: Explicitly import "regenerator-runtime" #2330
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Ref: https://jira.greenpeace.org/browse/PLANET-7565
DESCRIPTION:
After upgrading WordPress to its LTS version (6.6 of 16 July, 2024) the following errors were found:
Planet 4 Columns
block is not rendered in the front.Happypoint
block is not rendered in the front.Submenu
block is not rendered in the front.Articles
block is not rendered in the front.Covers
block is not rendered in the front.The browser console showed the following error message:
After research, I found that removing some polyfills in WordPress 6.6 caused the problem, and the solution suggested by some users was to explicitly import the
regenerator-runtime/runtime
dependency into the conflicted files:regenerator-runtime
instead ofwp-polyfill
WordPress/gutenberg#63091NOTES:
A similar change was made in the plugin repository, as well:
greenpeace/planet4-plugin-gutenberg-blocks#1222
Whilst importing the
regenerator-runtime
dependency only into the plugin is enough to fix the issue, once the P4 plugin is removed, we'll still need the importation in the theme codebase.TESTING:
npx wp-env run cli wp core update --version=6.6
ornpx wp-env run cli wp core update https://wordpress.org/wordpress-6.6.zip
on your terminal