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

React error #31 in IE11 #11597

Closed
dariaknl opened this issue Nov 14, 2018 · 1 comment
Closed

React error #31 in IE11 #11597

dariaknl opened this issue Nov 14, 2018 · 1 comment
Milestone

Comments

@dariaknl
Copy link
Contributor

dariaknl commented Nov 14, 2018

How can we reproduce this behavior?

  1. Use IE11.
  2. Activate Gutenberg 4.3.
  3. Go to SEO -> General.
  4. Check console:
    image 34

https://reactjs.org/docs/error-decoder.html/?invariant=31&args[]=object%20with%20keys%20%7B%24%24typeof%2C%20type%2C%20key%2C%20ref%2C%20props%2C%20_owner%7D&args[]=

  1. Open Conf wizard - it is not loaded.
  2. Open Dashboard - Yoast SEO Posts Overview is not loaded.

Technical info

  • WordPress version: 4.9.8
  • Yoast SEO version: 9.2 RC2
@dariaknl dariaknl added the regression Label for high-prio issue label Nov 14, 2018
@IreneStr IreneStr added this to the 9.2 milestone Nov 14, 2018
@IreneStr IreneStr added the queue label Nov 14, 2018
@moorscode moorscode added the IE11 label Nov 15, 2018
@afercia afercia added development and removed queue labels Nov 15, 2018
@afercia afercia self-assigned this Nov 15, 2018
@afercia
Copy link
Contributor

afercia commented Nov 15, 2018

Setting WP_DEBUG to true can help.

SEO > General

screenshot 136

Configuration Wizard:

screenshot 137

It appears we've already faced this issue. See #10539

I've seen in paths.js babel-polyfill is last:
Moving it as first thing in the vendor array fixes it for me. Metabox rendered in IE 11 with no errors. I'd strongly recommend to double check and test also on another Windows machine with IE 11.

Fixed in August in #10570

Then it was moved down in e5cf9a5#diff-a37b1891048cd474f06c611907cd00a0

Moved again to webpack/webpack.config.js in 01b3bf6#diff-a37b1891048cd474f06c611907cd00a0

Then, the refactoring of the dependencies happened.

Unfortunately, for Internet Explorer 11, some polyfills must be loaded as first thing before React and ReactDOM. Reference (Dan Abramov):
facebook/react#8379 (comment)

Additionally, we're now also importing babel-polyfill in js/src/wp-seo-analysis-worker.js.
More importantly, wp-polyfill is now registered as dependency for many scripts so it's enqueued after React and ReactDOM.

If we want to support IE11, this requires some re-thinking of the webpack configuration and the dependencies in order to ensure:

  • babel-polyfill is loaded (or compiled in the build) before React and ReactDOM
  • there's only one instance of babel-polyfill

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants