WordPress.org

Make WordPress Core

Opened 6 weeks ago

Closed 3 weeks ago

Last modified 3 weeks ago

#52972 closed defect (bug) (invalid)

WordPress background report jQuery error

Reported by: jack960330 Owned by:
Milestone: Priority: normal
Severity: normal Version: 5.7
Component: General Keywords: has-patch
Focuses: ui Cc:

Description

Here I have the following error:

https://files.slack.com/files-pri/T024MFP4J-F01TZEHPHNC/image.png

Upon investigation, it appears to be the following two documents:

wp-includes/js/jquery/jquery.js 
wp-includes/js/jquery/jquery.min.js

The following calls exist:

jQuery.noConflict()

Since the backend core of WordPress seems to already use jQuery instead of $, I think I can remove this call

The temporary solution is to delete it

Attachments (1)

1.png (93.4 KB) - added by jack960330 6 weeks ago.

Download all attachments as: .zip

Change History (6)

@jack960330
6 weeks ago

This ticket was mentioned in PR #1169 on WordPress/wordpress-develop by jack9603301.


5 weeks ago

  • Keywords has-patch added

We think that jQuery is already used in WordPress, so it makes no sense to enable noConflict mode

Trac ticket: https://core.trac.wordpress.org/ticket/52972

This ticket was mentioned in Slack in #core by jack960330. View the logs.


3 weeks ago

#3 @Clorith
3 weeks ago

Hiya,

Looking at your original issue, something appears to have modified the load order on your site, as jQuery is a dependency of the jQuery UI library (that those files causing errors originate with).

If you need help troubleshooting or resolving this, I would recommend creating a support forum post, where our support volunteers can help you out.

As for your followup on noConflict; this problem would not be resolved by not using noConflict, as that is a feature that makes jQuery not automatically bind to the $ shortcut.

The reason for core explicitly declaring noConflict is that multiple libraries use the $ shortcut, and binding it to WordPress directly has the potential to break plugins or themes.

Related #16494

#4 @jack960330
3 weeks ago

  • Resolution set to invalid
  • Status changed from new to closed

I reviewed my problem and although it was fixed by this method at the time, in the latest test, the problem disappeared, perhaps because of configuration issues that caused jQuery to not be loaded in a particular order. Sorry, this PR will be turned off

#5 @SergeyBiryukov
3 weeks ago

  • Milestone Awaiting Review deleted

Thanks for the follow-up!

Note: See TracTickets for help on using tickets.