1

I have a website that uses Woocommerce to sell products. The store was working fine until I updated to Wordress 5.5

Now whenever I edit a product, several elements in the post editor do not work. I can't remove a featured image, and I can't edit a post using the "Text" tab. Also when I click to set a featured image, it opens a new tab (taking me away from the post editor) with an archaic looking featured image page.

I looked in the console, and I am receiving this error:

 Uncaught TypeError: jQuery(...).live is not a function
      at HTMLDocument.<anonymous> (post.php?post=28000&action=edit:1636)
      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)

However, the stack trace isn't telling me much. Here are the paths in the stack trace:

First line: https://sitename.com/wp-admin/post.php?post=28000&action=edit

Second, Third, Fourth and Fifth lines: https://sitename.com/wp-includes/js/jquery/jquery.js?ver=1.12.4-wp

So the stack trace is pointing to jquery.js in Wordpress includes. This doesn't tell me much, as my Wordpress version is up to date at 5.5. I can't seem to figure out where the issue is coming from based on the stack trace, so I don't know where to fix this depreciated error from jQuery.

Is there anything I can do to fix this? I've tried using this plugin and that fixes the issue: https://wordpress.org/plugins/enable-jquery-migrate-helper/

However, this is only a temporary fix, so I don't want to use this method.

Alex Douglas
  • 534
  • 1
  • 8
  • 21

2 Answers2

0

From jQuery .live() function documentation

Note: This API has been removed in jQuery 1.9; please use on() instead.

probably jQuery was updated alongside WordPress and the function was deprecated.

roneicostajr
  • 89
  • 1
  • 5
  • Thanks, I am aware that the function is depreciated, I'm just wondering how I can fix this, when the stack trace points to a jquery install within Wordpress. – Alex Douglas Sep 30 '20 at 18:44
0

I have to find everywhere .live() is used in the site files and replace with .on(). This fixes the issue!

Alex Douglas
  • 534
  • 1
  • 8
  • 21