• Resolved gullwingio

    (@gullwingio)


    Hello,

    We are trying to use this plugin in WordPress 6.2.2 on a WordPress VIP account but we get an error when deployed.

    Locally it works totally fine but when we deploy and goto page creation we see the following error:

    TypeError: Cannot read properties of undefined (reading 'page') at https://my-website.com/wp-includes/js/dist/edit-post.min.js?ver=d098b8ee5bdffa238c03:7:30074 at https://my-website.com/wp-includes/js/dist/data.min.js?ver=90cebfec01d1a3f0368e:2:11372 at https://my-website.com/wp-includes/js/dist/redux-routine.min.js?ver=d86e7e9f062d7582f76b:9:790 at https://my-website.com/wp-includes/js/dist/data.min.js?ver=90cebfec01d1a3f0368e:2:10206 at Object.dispatch (https://my-website.com/wp-includes/js/dist/data.min.js?ver=90cebfec01d1a3f0368e:2:11315) at Object.initializeMetaBoxes (https://my-website.com/wp-includes/js/dist/data.min.js?ver=90cebfec01d1a3f0368e:2:18700) at https://my-website.com/wp-includes/js/dist/edit-post.min.js?ver=d098b8ee5bdffa238c03:7:103729 at Ir (https://my-website.com/wp-includes/js/dist/vendor/react-dom.min.js?ver=18.2.0:10:73407) at xl (https://my-website.com/wp-includes/js/dist/vendor/react-dom.min.js?ver=18.2.0:10:93227) at https://my-website.com/wp-includes/js/dist/vendor/react-dom.min.js?ver=18.2.0:10:91969

    However we can get around it by adding &concat_js=no to the query param of a page edit.

    Is this something anyone else has seen before or has any ideas with? It is only on pages that use this component.

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author merbmerb

    (@merbmerb)

    I have not heard of anyone else having this problem. Really strange that ‘&concat_js=no’ gets rid of the problem. Should be the same core code just not minimized.

    Thread Starter gullwingio

    (@gullwingio)

    Thank you for the response.

    So yeah the editor doesn’t load, you just get this error unless you add the ‘&concat_js=no’?

    I’m trying think off anything else interesting I can give you. Local works fine but thats because it has ‘&concat_js=no’?on by default. As soon as we deploy to our development environment we get this issue.

    Without concat_js, we can see in the console jquery not being defined, which is the only thing we have to go on. We are unsure of the VIP build steps, but we guess it’s doing something because we noticed that it stripped out the?javascript:?part from?<a href='javascript:void()'...?so assuming the build step has some kind of security sanitation or something that isn’t present locally.

    The only other thing we can think is its a WIPVIP instance / build where we raised a ticket as well.

    Plugin Author merbmerb

    (@merbmerb)

    OK, so the jQuery not defined rang a bell for me. Not sure if this is the problem but as of 2.1 I use .ready for jQuery (the recommended method) and it can break other plugins/themes. Not sure why this would break the editor or why concat_js would make a difference. See this thread

    https://www.ads-software.com/support/topic/v2-1-update-exposes-some-js-issues-in-theme/

    • This reply was modified 1 year, 1 month ago by merbmerb.
    Thread Starter gullwingio

    (@gullwingio)

    Just for anyone might might run into this, we had to do the following:

    In your client-mu-plugins/vip-gutenberg-config.php file:

    add_filter( 'js_do_concat', 'my_vip_js_concat_filter', 999, 2 );
    function my_vip_js_concat_filter( $do_concat, $handle ) {
        if ( is_admin()) {
            return false;
        }
        return $do_concat;
     }
    Thread Starter gullwingio

    (@gullwingio)

    My comment above has now proven to be wrong, it was actually the WordPress version and this plugin. When we upgraded WordPress VIP to 6.3 we could remove this code and the plugin works fine, with 6.2 you need &concat_js=no in the URL else you get this error.

    • This reply was modified 1 year, 1 month ago by gullwingio.
    Plugin Author merbmerb

    (@merbmerb)

    That’s good news, it always seemed a little strange. Thanks for your update!

    Thread Starter gullwingio

    (@gullwingio)

    We also just discovered if anyone else has this issue, WP 6.2 running on VIP you can also add this:

    client-mu-plugins/plugin-loader.php

    if ( is_admin() ) {
        remove_action( 'init', 'js_concat_init' );
    }

    This also fixes it for that version

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Error in the editor’ is closed to new replies.