Getting console error after updating X theme

I updated X theme from 6.0.4 to 6.2.2 and get this error in the console in the x/framework/dist/js/site/x.js file:

Cannot read property ‘filter’ of undefined

You can see here: http://eversight.staging.wpengine.com/

Looks like the error starts at:

k.csHooks.filter("scrollspy_selector",'a[href*="#"]');

Any ideas on how to resolve? It’s preventing all my other custom js scripts from executing.

Hey there,

Thanks for writing in! I see you’ve updated X but haven’t updated the Cornerstone plugin. Always make sure to update both X and Cornerstone to avoid such errors and potential conflicts. You can find the latest version numbers here: (http://theme.co/changelog/) Then you can compare them to what’s installed on your site.

If you find anything to be out of date, you can review our update guide.

Let us know how this goes!

Thanks @Nabeel that worked! I’m running monthly maintenance on a website with X and I update themes before I update plugins. I checked site after updating theme and before updating plugins.

After updating theme and plugin I ran into the issue of X’s slick js overriding my child slick js. I fixed this by simply enqueueing my slick js after X’s slick js - adding dependencies to wp_enqueue_script:

wp_enqueue_script('cooper_plugins', get_stylesheet_directory_uri() . '/assets/js/plugins.js', array('jquery', 'x-site'), null, true);
wp_enqueue_script('cooper_site', get_stylesheet_directory_uri() . '/assets/js/front.js', array('jquery', 'x-site'), null, true);

Note where I put “x-site” inside the dependency array. :slight_smile:

Thanks so much for the help!

You’re welcome and thanks for sharing you’re code. Have a nice day! :slight_smile:

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.