I am building a WordPress site and suddenly am getting the error:
Uncaught TypeError: jQuery(...).live is not a function
at HTMLDocument.<anonymous> (main.js?ver=1.1:214)
at i (jquery.js?ver=1.12.4-wp:2)
at Object.fireWith [as resolveWith] (jquery.js?ver=1.12.4-wp:2)
at Function.ready (jquery.js?ver=1.12.4-wp:2)
at HTMLDocument.J (jquery.js?ver=1.12.4-wp:2)
I am unsure how to replicate this error as it is a sudden occurrence.
When I visit my site no images are loading which have JS
I have checked my plugins and don’t seem to see anything new added when I view the site in Elementor all images are showing, any ideas of how to fix this? None of this site has been raw coded just pure WordPress
Can anyone inspect element and tell me if/what plugin is causing me issues?
2
Answers
Wordpress 5.5 stopped using jquery migrate. It's been causing problems with old plugins and themes. This is the fix: https://wordpress.org/plugins/enable-jquery-migrate-helper/
WordPress 5.5 stopped using jQuery migrate. This change has been causing problems with old plugins and themes. If you are noticing issues after upgrading to WordPress 5.5, installing this plugin might fix it: https://wordpress.org/plugins/enable-jquery-migrate-helper/
Though, ultimately a better solution would be to either upgrade your current plugins and themes to versions that do not rely on jQuery migrate. Or, if that is not possible, try to move away from those plugins to ones that do not require jQuery migrate. If you don’t, you will likely run into compatibility issues in the future or, even worse, security vulnerabilities from these outdated plugins/themes.
UPDATE: Sep 18, 2020
I looked at the source code for the Enable jQuery Migrate Helper plugin and it has this condition for running:
So, the plugin will only work up to, and including, WordPress 5.5. Once WordPress hits version 5.6-alpha, it will stop working.
UPDATE: Feb 15, 2021
The plugin code has been updated to work past WordPress 5.6. However, at and after version 5.6, it will include
jquery-migrate-3.3.2
instead ofjquery-migrate-1.4.1
and it includes a lot fewer files (mostly jquery-ui scripts). If you want to continue using the older version of jquery, there are a couple options.Option A. You could copy the jquery migrate plugin to a new folder (basically make it your own plugin), rename it, edit the
class-jquery-migrate-helper.php
file, find this line in thereplace_scripts
function:And replace it with:
This will cause the plugin to always install the old version of jquery.
Option B. Create a new plugin that just includes the old jquery files by doing the following:
enable-jquery-migrate-helper/js
files from the jquery migrate plugin to thejs/
folder in your new plugin.