Amp-wp: i18n polyfill is incomplete

Created on 24 Jun 2019  路  24Comments  路  Source: ampproject/amp-wp

I got issues with Yoast SEO on WordPress 4.9 on loading the first panel.

After a bit of JS debugging I discovered that the problem it is the polyfill of this plugin that is loaded by yoast (because of the script name wp-i18n) that is the same of WP 5.x and used by that plugin.

Replacing the content of the js file of this plugin with the official from WP 5.2.1 is fixing the issue.

Ref: https://wordpress.org/support/topic/first-tab-traffic-lights-is-empty/

Bug

All 24 comments

Please, can you explain in more detail what js file must be replaced and with what one?
Thank you. I've got the same issue

I replaced the same filename in the plugin but I saw that there was other issues so I downgraded the plugin to avoid other future issues.

Ok, I will not delve through it until the next update, but it works with my other themes. In this specific case I use my own custom theme and it doesn't work

I found the problem with Yoast Blank. Recently I swtiched to the 7.3 latest Stable PHP version on my server. Today I tried to go back to PHP 7.2 -- yoast meta box is visible again :) Yoast is not compatible with 7.3 php

I am already using php 7.2 but isn't a php problem but a JS one because of the errors in console.
I got another website with the same issue with wp 4.9 yoast and AMP. Again downgrading AMP fixed the problem.

Yes, but when I was on PHP 7.3, I had in console the same JS error, now there is no errors in console

In premium Yoast support some people are experiencing blank pages at all, not only meta box. Something wrong with new Yoast release, but developers are not in a hurry to solve the issue

@Mte90 @kievbridge Just to be clear. This happens only when using WordPress 4.9 with Yoast SEO and the AMP plugin 1.2? If so, I'll try to reproduce.

No, my specs: Wordpress 5.2.2, no AMP plugin. But I was experiencing the same problem when switching to PHP 7.3. Meta-box of YOAST was blank

@kievbridge Sorry, but this is the wrong place for your help request then, as this project here is for the AMP Plugin, not Yoast SEO. Please head over to https://github.com/Yoast/wordpress-seo instead to report your issue with Yoast SEO directly. Thanks!

This is happened with WP 4.9 in 2 different websites on my testing

Closing as not related to AMP Plugin. Please get support from https://github.com/Yoast/wordpress-seo instead.

It is related because the polyfill included in this plugin is registered as wp-i18n so any plugin that is looking for it is loading it like the yoast one.
Because the polyfill included in this plugin is completelly different from the original included in wp 5.2 the others plugin crash because are missing stuff.
With a test with WP 4.9, Yoast and AMP it is possible to see that the js library is loaded on backend where shouldn't be from other plugins.

Right now I am keeping a previous version everywhere to avoid conflcits with yoast and maybe other plugins.
Basically this plugin is creating conflicts with others from the JS side.

Thanks @Mte90. I was planning on doing some testing today to see what the issue here is.

Our code basically just re-exports the Gutenberg version:

https://github.com/ampproject/amp-wp/blob/6f69fe25eded883c4cbd82bdac23c3967166b9bd/assets/src/polyfills/wp-i18n.js#L1-L10

However, looking at that code, I think this needs to be window.wp.i18n, not just wp.i18n...

@Mte90 Heya, could you give the updated code at #2688 a try? There's a ZIP file that you can use to replace the plugin on your existing site for testing.

Same issue here.
4.9 + AMP 1.2 + Yoast 11.3, 11.4, 11.5 same issue.
Disable the plugin AMP 1.2 and everything works, and this is what I have done for the client.

@planetahuevo Please use the updated ZIP from #2688 for now.

Same error Blank Box Yoest.
use 4.9
Yoast 11.4 + 11.5
Amp 1.2
Solve : use AMP Version 1.1.3

@hamouhisham Please test this updated plugin version: amp.zip

In any case, you should consider updating to WordPress 5.2. If you need the old editor, you can install the Classic Editor plugin.

any updates for the release with the bugfix?

@Mte90 We're planning on releasing 1.2.1 with this bugfix within the next week or so. Currently finishing up everything.

@Mte90 Please test the 1.2.1-beta1 pre-release we pushed out today: https://github.com/ampproject/amp-wp/releases/tag/1.2.1-beta1

@swissspidy Any idea when this new release is going out? I am having the same issue.

@sarahquigley As there were some delays with some additional bugs that we wanted to fix, there's no exact release date at the moment. However, the beta version mentioned above should be stable enough for usage for now.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

miina picture miina  路  3Comments

luizeof picture luizeof  路  4Comments

westonruter picture westonruter  路  5Comments

miina picture miina  路  5Comments

miina picture miina  路  5Comments