WordPress.org

Make WordPress Core

Opened 9 days ago

Last modified 23 hours ago

#48273 new defect (bug)

ReferenceError: jQuery is not defined

Reported by: bhartvigsen Owned by:
Milestone: Awaiting Review Priority: normal
Severity: critical Version:
Component: Script Loader Keywords: reporter-feedback
Focuses: Cc:
PR Number:

Description

There is a bug in the latest version (Version 5.2.3), it's throwing:

ReferenceError: jQuery is not defined

All over the admin.

To reproduce:

  • Setup a web server with Ubuntu, MySQL 5.7, PHP 7.2 and nginx 1.10 using a off-the-shelf wordpress config.
  • wget https://wordpress.org/latest.tar.gz, extract
  • chown -R www-data:www-data <wordpress install folder> and chmod -R g+rw <wordpress install folder>
  • Copy wp-config-sample.php to wp-config.php
  • Edit wp-config.php and edit ONLY DB_NAME, DB_USER, DB_PASSWORD, and DB_HOST with the credentials for a MySQL user that has full access to the DB in question
  • Visit site URL
  • Select 'English', provide a username, password
  • Login to new installation admin, notice that there are SEVEN fatal JS errors due to jQuery not defined issue

I discovered this on a live site because it broke the 'create page' functionality after an update. After installing a fresh copy with a fresh database I discovered that this is a bug in WordPress rather than a configuration issue.

Change History (5)

#1 @peterwilsoncc
9 days ago

  • Keywords reporter-feedback added

Hi @bhartvigsen and welcome to trac!

I'm unable to reproduce this using 5.2.3, does the issue occur when using a default theme without any plugins enabled?

Many thanks,
Peter

#2 @SergeyBiryukov
7 days ago

Thanks for the report! However, I could not reproduce it either.

  1. Which browser are you using?
  2. Could you make sure jQuery is not blocked by a browser extension or antivirus software?
  3. What happens if you open the URL directly, e.g. http://mysite.com/wp-includes/js/jquery/jquery.js?

#3 @SergeyBiryukov
7 days ago

  • Component changed from General to Script Loader

#4 @happy-pillz
23 hours ago

Hi, I think I have the same issue.

Whenever I try to access 'all page' or 'all posts' menus, I get a broken layout. here are screenshots:
https://wetransfer.com/downloads/8a75b728e251f77600acefe6a411a44f20191017211156/331ebb

When I check the console, I get tens of 'jQuery is not defined' errors.

When I try to edit a post I get the error The editor has encountered an unexpected error

I deactivated all plugins through health-check plugin, used nineteen theme, reinstalled the last wordpress three times, and still got the error.

when I check site/wp-includes/js/jquery/jquery.js, I have a lot of code in the page, starting with:
/*! jQuery v1.12.4 | (c) jQuery Foundation | jquery.org/license | WordPress 2019-05-16 */
!function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this .......

FI, I manage another wordpress site that does not have this issue.

#5 @happy-pillz
23 hours ago

hi again, below more information:

  • I deactivated security plugin wordfence and regenerated htaaccess (through settings>permalink>save).
  • I can now access 'all pages' and 'all posts', both layouts looks normal, but I still have console errors: Uncaught TypeError: a.widget is not a function, Uncaught TypeError: jQuery(...).sortable is not a function,Uncaught TypeError: Cannot read property 'mouse' of undefined
  • I still cannot edit posts and pages, and have the same error: The editor has encountered an unexpected error, with console error jQuery is not defined
  • most menus are now broken, like dashboard, settings.
Note: See TracTickets for help on using tickets.