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

i18n polyfill is incomplete #2679

Closed
Mte90 opened this issue Jun 24, 2019 · 22 comments

Comments

@Mte90
Copy link

commented Jun 24, 2019

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/

@kievbridge

This comment has been minimized.

Copy link

commented Jun 24, 2019

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

@Mte90

This comment has been minimized.

Copy link
Author

commented Jun 24, 2019

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.

@kievbridge

This comment has been minimized.

Copy link

commented Jun 24, 2019

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

@kievbridge

This comment has been minimized.

Copy link

commented Jun 25, 2019

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

@Mte90

This comment has been minimized.

Copy link
Author

commented Jun 25, 2019

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.

@westonruter westonruter added this to the v1.2.1 milestone Jun 25, 2019

@kievbridge

This comment has been minimized.

Copy link

commented Jun 25, 2019

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

@kievbridge

This comment has been minimized.

Copy link

commented Jun 25, 2019

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

@swissspidy

This comment has been minimized.

Copy link
Collaborator

commented Jun 25, 2019

@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.

@kievbridge

This comment has been minimized.

Copy link

commented Jun 25, 2019

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

@swissspidy

This comment has been minimized.

Copy link
Collaborator

commented Jun 25, 2019

@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!

@Mte90

This comment has been minimized.

Copy link
Author

commented Jun 25, 2019

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

@amedina

This comment has been minimized.

Copy link
Member

commented Jun 26, 2019

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

@amedina amedina closed this Jun 26, 2019

@westonruter westonruter removed this from the v1.2.1 milestone Jun 26, 2019

@Mte90

This comment has been minimized.

Copy link
Author

commented Jun 26, 2019

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.

@swissspidy

This comment has been minimized.

Copy link
Collaborator

commented Jun 26, 2019

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:

/**
* WordPress dependencies
*/
import * as i18n from '@wordpress/i18n';
if ( ! window.wp ) {
window.wp = {};
}
wp.i18n = i18n;

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

@swissspidy swissspidy reopened this Jun 26, 2019

@swissspidy swissspidy added this to the v1.2.1 milestone Jun 26, 2019

@swissspidy

This comment has been minimized.

Copy link
Collaborator

commented Jun 26, 2019

@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.

@swissspidy swissspidy added this to Ready for Merging in AMP Stories Jun 26, 2019

@planetahuevo

This comment has been minimized.

Copy link

commented Jun 27, 2019

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.

@swissspidy

This comment has been minimized.

Copy link
Collaborator

commented Jun 27, 2019

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

@hamouhisham

This comment has been minimized.

Copy link

commented Jun 28, 2019

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

@swissspidy

This comment has been minimized.

Copy link
Collaborator

commented Jun 28, 2019

@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.

@Mte90

This comment has been minimized.

Copy link
Author

commented Jul 17, 2019

any updates for the release with the bugfix?

@swissspidy

This comment has been minimized.

Copy link
Collaborator

commented Jul 17, 2019

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

@westonruter

This comment has been minimized.

Copy link
Member

commented Jul 18, 2019

@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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.