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

PLANET-7565: Explicitly import "regenerator-runtime" #2330

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mardelnet
Copy link
Contributor

@mardelnet mardelnet commented Jul 24, 2024

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:

  1. Planet 4 Columns block is not rendered in the front.
  2. Happypoint block is not rendered in the front.
  3. Submenu block is not rendered in the front.
  4. Articles block is not rendered in the front.
  5. Covers block is not rendered in the front.
  6. All the patterns that include the previously mentioned blocks are also affected.

The browser console showed the following error message:

Screenshot from 2024-07-24 14-13-23

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:


NOTES:
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:

  • Locally: Run npx wp-env run cli wp core update --version=6.6 or npx wp-env run cli wp core update https://wordpress.org/wordpress-6.6.zip on your terminal

- regenerator-runtime was explicitly imported into the files with errors due to the changes implemented in WordPress 6.6
@planet-4
Copy link
Contributor

Test instance is ready 🚀

🌑 iocaste | admin | blocks report | CircleCI | composer-local.json

⌚ 2024.07.24 12:56:43

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