Yoast / wordpress-seo

Yoast SEO for WordPress
https://yoast.com/wordpress/plugins/seo/
Other
1.77k stars 891 forks source link

Javascript errors #10800

Closed CharlieNY closed 6 years ago

CharlieNY commented 6 years ago

Please give us a description of what happened.

When updating YOAST to version 8.0 the media library stops functioning and 3 javascript errors appear:

1: Uncaught TypeError: Cannot read property 'memoize' of undefined at load-scripts.php?c=0&load[]=thickbox,hoverIntent,common,admin-bar,shortcode,wp-backbone,media-models,wp-plupload,wp-mediaelement,wp-api-request,media-views,&load[]=media-editor,media-audiovideo,mce-view,imgareaselect,image-edit,media-grid,media,svg-painter,heartbeat,wp-auth-check,jquery-ui-t&load[]=ooltip,jquery-ui-slider,jquery-touch-punch,iris,wp-color-picker,wpdialogs&ver=4.9.8:343 at load-scripts.php?c=0&load[]=thickbox,hoverIntent,common,admin-bar,shortcode,wp-backbone,media-models,wp-plupload,wp-mediaelement,wp-api-request,media-views,&load[]=media-editor,media-audiovideo,mce-view,imgareaselect,image-edit,media-grid,media,svg-painter,heartbeat,wp-auth-check,jquery-ui-t&load[]=ooltip,jquery-ui-slider,jquery-touch-punch,iris,wp-color-picker,wpdialogs&ver=4.9.8:343

2: Uncaught TypeError: (0 , Y.flowRight) is not a function at Object. (wp-seo-wp-globals-backport-800.min.js:27) at t (wp-seo-wp-globals-backport-800.min.js:1) at Object. (wp-seo-wp-globals-backport-800.min.js:1) at t (wp-seo-wp-globals-backport-800.min.js:1) at Object. (wp-seo-wp-globals-backport-800.min.js:11) at t (wp-seo-wp-globals-backport-800.min.js:1) at Object. (wp-seo-wp-globals-backport-800.min.js:11) at t (wp-seo-wp-globals-backport-800.min.js:1) at Object. (wp-seo-wp-globals-backport-800.min.js:11) at t (wp-seo-wp-globals-backport-800.min.js:1)

3: Uncaught TypeError: Cannot read property 'styledComponents' of undefined at Object. (wp-seo-modal-800.min.js:1) at e (commons-800.min.js:1) at Object. (wp-seo-modal-800.min.js:59) at e (commons-800.min.js:1) at Object. (wp-seo-modal-800.min.js:59) at e (commons-800.min.js:1) at Object. (wp-seo-modal-800.min.js:59) at e (commons-800.min.js:1) at window.yoastWebpackJsonp (commons-800.min.js:1) at wp-seo-modal-800.min.js:1

We expected a normal transition to the newer version without any conflicts, the previous version of YOAST causes none of the above issues.

How can we reproduce this behavior?

  1. Install latest version of WordPress
  2. Install Latest version of YOAST
  3. Use any Theme

Screenshots

If applicable, add screenshots to help explain your problem.

Additional context

Add any other context about the problem here.

Technical info

We are unable to install any other theme using any standard method:

benvaassen commented 6 years ago

Thanks for reporting this issue. Unfortunately, we were not able to reproduce this problem when we follow your steps to reproduce. I've used Yoast SEO 8.0, WordPress 4.9.8 and the WordPress default theme Twenty Seventeen. Therefore, I'm closing this.

Looking at the first JavaScript error, I think it's triggered by another plugin or theme. Therefore, we'll need to know if this behavior is caused by a conflict with a plugin or theme. You can use the Health Check plugin to check for conflicts (how to check for plugin conflicts). We always recommend to regularly create a backup.

To receive free support for Yoast SEO we have the following channels:

Thank you for your understanding.

aschmoe commented 5 years ago

@benvaassen @CharlieNY I inspected the bundled code and looks like the issue on my end is

 2: function(e, t) {
        e.exports = window.lodash
    },

where wp-compose-921.min.js?ver=4.9.8 is assuming lodash is on the window

aschmoe commented 5 years ago

If any plugin or theme is also registering lodash, it is likely undoing this register https://github.com/Yoast/wordpress-seo/blob/trunk/admin/class-admin-asset-manager.php#L194, and https://github.com/Yoast/wordpress-seo/blob/trunk/js/vendor/lodash-noconflict.js is not happening.

Might be worth it to change the lodash register tag to lodash-compat since it seems likely many plugins load lodash

ryankidd commented 5 years ago

@CharlieNY Today I ran into a similar issue. Parts of the Yoast meta box were missing and the console was full of errors. Turns out the Yoast plugin was missing the vendor directory. The .gitignore file was excluding it. After fixing the rule, the missing /vendor files turned up and all was well.