Uncaught TypeError: Cannot read property ‘msie’ of undefined when upgrading to WordPress 5.5

Recently when upgrading an older site to WordPress 5.5 I noticed a javascript error in the console that read Uncaught TypeError: Cannot read property ‘msie’ of undefined.

If you have a plugin or script that relied on an older version of jQuery it will no longer work because WordPress updated their jQuery version. In order to fix add this to the top of your scripts file

jQuery.browser = {};
(function () {
jQuery.browser.msie = false;
jQuery.browser.version = 0;
if (navigator.userAgent.match(/MSIE ([0-9]+)./)) {
jQuery.browser.msie = true;
jQuery.browser.version = RegExp.$1;
}
})();

 

The post Uncaught TypeError: Cannot read property ‘msie’ of undefined when upgrading to WordPress 5.5 appeared first on Bootstrap Creative.

Generated by Feedzy