• Resolved Viktor Nagornyy

    (@viktorix)


    The plugin’s page says AMP plugin is compatible with v4.9 but it doesn’t work. It throws an error looking for i18n, which was added for Gutenberg. Do you plan to maintain compatibility with v4.9 or is the compatibility tag wrong? Maintaining compatibility with v4.9 also ensures the plugin works with the ClassicPress fork, which is where I noticed this issue.

    A team member from Beaver Builder shared a polyfill that fixes this issue for now. I’m sharing it for reference in case someone else needs it:

    Check and enqueue script:

    if ( ! wp_script_is( 'wp-i18n', 'registered' ) ) {
    			wp_enqueue_script( 'fl-wp-i18n', "{$js_vendors}i18n-polyfill.js" );
    		}

    JavaScript file:

    window.wp = window.wp || {};
    window.wp.i18n = {};

    Thanks.

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author Weston Ruter

    (@westonruter)

    It is supposed to work in 4.9 still, although some functionality is disabled since it requires 5.3 and above. We’ll look into fixing compatibility with 4.9 so that no error is emitted.

    Plugin Author Weston Ruter

    (@westonruter)

    @viktorix What version of Gutenberg are you running on 4.9? You have to be running an old version since the current version requires a more recent version of WP. Or is this error appearing on the classic editor screen? Or actually, from the link you shared the issue is specifically showing up on the AMP settings screen? Please confirm which screens which include this error.

    Plugin Support Milind More

    (@milindmore22)

    Hello @westonruter

    I can confirm this on the AMP settings screen with WP 4.9

    
    Uncaught TypeError: Cannot read property 'i18n' of undefined
        at wp-api-fetch.js?ver=7645fa7ef83c5d94141bdac792ab796a:1
        at Object.2 (wp-api-fetch.js?ver=7645fa7ef83c5d94141bdac792ab796a:1)
        at r (wp-api-fetch.js?ver=7645fa7ef83c5d94141bdac792ab796a:1)
        at Object.48 (wp-api-fetch.js?ver=7645fa7ef83c5d94141bdac792ab796a:1)
        at r (wp-api-fetch.js?ver=7645fa7ef83c5d94141bdac792ab796a:1)
        at Module.<anonymous> (wp-api-fetch.js?ver=7645fa7ef83c5d94141bdac792ab796a:1)
        at Module.216 (wp-api-fetch.js?ver=7645fa7ef83c5d94141bdac792ab796a:1)
        at r (wp-api-fetch.js?ver=7645fa7ef83c5d94141bdac792ab796a:1)
        at Object.215 (wp-api-fetch.js?ver=7645fa7ef83c5d94141bdac792ab796a:1)
        at r (wp-api-fetch.js?ver=7645fa7ef83c5d94141bdac792ab796a:1)
    admin.php?page=amp-options:81 
    
    Uncaught ReferenceError: wp is not defined
        at admin.php?page=amp-options:81
    
    Plugin Support Milind More

    (@milindmore22)

    Hello @viktorix

    I have filed an issue for the same, please subscribe to issue to get updates.

    marktdavenport

    (@marktdavenport)

    @westonruter The reason for using WP 4.9 or ClassicPress is that there is no Gutenberg at all, any version.

    Thread Starter Viktor Nagornyy

    (@viktorix)

    @milindmore22 thanks, I appreciate this.

    Plugin Support Milind More

    (@milindmore22)

    Hello @viktorix and @marktdavenport

    JFI : We have merged a fix in v2.1 feel free update plugin to latest version let us know if you have any feedback.

    Plugin Support Milind More

    (@milindmore22)

    As we didn’t receive a response I’ll mark this as resolved. Feel free to open a new support topic if you require any further assistance.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘WordPress 4.9 compatability’ is closed to new replies.