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

WP 6.6 RC1: Custom blocks stopped working #63009

Closed
leoloso opened this issue Jul 1, 2024 · 5 comments
Closed

WP 6.6 RC1: Custom blocks stopped working #63009

leoloso opened this issue Jul 1, 2024 · 5 comments
Labels
[Type] Bug An existing feature does not function as intended [Type] Plugin Interoperability Incompatibilities between a specific plugin and the block editor. Close with workaround notes.

Comments

@leoloso
Copy link

leoloso commented Jul 1, 2024

Description

In my plugin, I have a CPT that loads custom blocks. After upgrading to v6.6 RC1, all the custom blocks stopped working:

Screenshot 2024-07-01 at 16-20-13 Add New GraphQL Schema Configuration ‹ Gato GraphQL — WordPress

The compiled blocks are targeting WordPress 5.4, they work all the way down there. If possible, I'd expect them to still work on WP 6.6.

Error in the JS console:

Uncaught TypeError: L.a is undefined
    <anonymous> https://gatographql-pro.lndo.site/wp-content/plugins/gatographql/blocks/schema-config-composable-directives/build/index.js?ver=7bc47881f5458ab13f7b8b29b9ee3745:1
    a https://gatographql-pro.lndo.site/wp-content/plugins/gatographql/blocks/schema-config-composable-directives/build/index.js?ver=7bc47881f5458ab13f7b8b29b9ee3745:1
    n https://gatographql-pro.lndo.site/wp-content/plugins/gatographql/blocks/schema-config-composable-directives/build/index.js?ver=7bc47881f5458ab13f7b8b29b9ee3745:1
    <anonymous> https://gatographql-pro.lndo.site/wp-content/plugins/gatographql/blocks/schema-config-composable-directives/build/index.js?ver=7bc47881f5458ab13f7b8b29b9ee3745:1
    <anonymous> https://gatographql-pro.lndo.site/wp-content/plugins/gatographql/blocks/schema-config-composable-directives/build/index.js?ver=7bc47881f5458ab13f7b8b29b9ee3745:1

I did npm start to get a friendlier error msg:

Uncaught TypeError: _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a is undefined
    js resolvers.js:60
    Webpack 14
        __webpack_require__
        js
        __webpack_require__
        js
        __webpack_require__
        js
        __webpack_require__
        js
        __webpack_require__
        js
        __webpack_require__
        checkDeferredModules
        <anonymous>
        <anonymous>
[resolvers.js:60:3](webpack:////Users/leo/GitRepos/GitHub/Projects/leoloso/PRO/submodules/ExtensionStarter/submodules/GatoGraphQL/layers/GatoGraphQLForWP/plugins/gatographql/packages/components/src/store/resolvers.js)
    js resolvers.js:60
    Webpack 14

That first error on resolvers.js:60 points to this line in the code:

	* getTypeFields( keepScalarTypes = false, keepIntrospectionTypes = false ) {

The block uses these deps in package.json:

{
    "devDependencies": {
        "@gatographql/api-fetch": "file:../api-fetch",
        "@wordpress/base-styles": "^2.0.0",
        "@wordpress/components": "^10.0.0",
        "@wordpress/compose": "^3.19.0",
        "@wordpress/data": "^4.22.0",
        "@wordpress/edit-post": "^3.21.0",
        "@wordpress/scripts": "^12.1.0",
        "prettier": "npm:[email protected]",
        "raw-loader": "^4.0.2",
        "react-select": "^3.0.8"
    }
}

Switching to @wordpress/scripts version 27.9 also produces the same error.

Step-by-step reproduction instructions

  1. Install WP 6.6 RC1
  2. Have plugin Gato GraphQL installed
  3. Go to "Schema Configurations" > Add new (eg: mysite.com/wp-admin/post-new.php?post_type=graphql-schemaconfig), which goes to the WordPress editor for that CPT
  4. All the blocks fail loading

Screenshots, screen recording, code snippet

Screenshot 2024-07-01 at 4 49 07 PM

Environment info

  • WordPress 6.6 RC1
  • Gato GraphQL plugin v2.6.0 (the latest one)

Please confirm that you have searched existing issues in the repo.

Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

Yes

@leoloso leoloso added the [Type] Bug An existing feature does not function as intended label Jul 1, 2024
@leoloso
Copy link
Author

leoloso commented Jul 2, 2024

Still happening with RC2

@talldan talldan added the [Type] Plugin Interoperability Incompatibilities between a specific plugin and the block editor. Close with workaround notes. label Jul 3, 2024
@talldan
Copy link
Contributor

talldan commented Jul 3, 2024

@leoloso It's not related to anything in the gutenberg codebase, as with the gutenberg plugin active on 6.5, your plugin works too.

I did a git bisect on WordPress core code and narrowed it down to this core commit - WordPress/wordpress-develop@f525e66.

It seems like the removal of some polyfills (that your plugin must depend on) has caused the issue, probably with the generators given where the error happens. You could probably look to include the polyfills in your own compiled code to solve the issue, though I'm not personally aware of what's required.

If you want to discuss it, here's the trac ticket (not sure if you're aware, but trac is the bug ticketing system for WordPress core, you'll need a wordpress.org user account to comment) - https://core.trac.wordpress.org/ticket/60962.

I'll also drop a comment on the trac ticket to mention this issue.

@talldan talldan closed this as not planned Won't fix, can't repro, duplicate, stale Jul 3, 2024
@talldan
Copy link
Contributor

talldan commented Jul 3, 2024

@leoloso Reading through that trac ticket, the comment here might be relevant for you.

@swissspidy
Copy link
Member

Let's continue discussion at GatoGraphQL/GatoGraphQL#2710 otherwise

@leoloso
Copy link
Author

leoloso commented Jul 4, 2024

Hi @talldan @swissspidy I appreciate your input and help. Thanks!

I've redone all the data stores in my plugin: I've removed the generators (so no need for the polyfill), using the source code from here:

https://github.com/WordPress/gutenberg/blob/1b6b4b8d8439b7cc0b0d90334a3b7cccaa665b45/packages/block-directory/src/store/index.js

The JS error doesn't happen anymore, hurray!

However, there is another problem. I'll post it on a separate issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Type] Bug An existing feature does not function as intended [Type] Plugin Interoperability Incompatibilities between a specific plugin and the block editor. Close with workaround notes.
Projects
Status: Done
Development

No branches or pull requests

3 participants