‘jQuery is not defined Error’ appearing in load-scripts.php

I’m writing this question having already found a solution, in order to see whether other people have encountered this problem.

I was having a problem on the back end of a site I am building in wordpress in which all the jquery scripts that I tried to load using the native wordpress handles (i.e. jquery-ui-core, jquery-ui-sortable, etc) were not loading. If I checked the state of those script handles using the wp_script_is() function, it showed that they were registered, enqueued, but not printed. At the same time my load-scripts.php file was registering an error: “jQuery not defined’.

Read More

It turns out that this problem has something to do with a new feature added in WordPress 3.5 that attempts to concatenate all javascript requests into a single call. This feature, however, was causing conflicts for some reason with some plugins. That at least is what Kevin Leary has reported here. The solution that Leary describes is to disable this feature by adding the following line to the wp-config.php file (after the line defining the ABSPATH):

define('CONCATENATE_SCRIPTS', false);

Does anyone understand why this bug is occurring? And is this a bug in the new version of WordPress?

Related posts

Leave a Reply

1 comment

  1. From this OP comment:

    although the site itself deregisters the main wordpress jquery handle and the re-registers it to point to the google cdn verrsion

    That is your problem.

    The problem isn’t an issue with WordPress 3.5 per se, nor is it a problem with Plugins.

    The problem is that you’re deregistering the core jQuery version (itself an inherent problem, that causes all sorts of other problems), and you’re probably doing so at an action that causes other scripts not to be able to grab jQuery as a required dependency.