jquery - WP Admin missing icons, numerous JavaScript errors, but only when SCRIPT_DEBUG is false

admin2025-06-05  2

I have access to a single Linux/Apache server where I'm trying to deploy WordPress. For purposes of this error, I've tested it with the default twentyseventeen theme and all plugins disabled.

When I go to any wp-admin page, logged in as an administrator, most of the icons from the left navigation are missing, checked checkboxes have no checks (for example), and the browser console fills with JavaScript errors.

For example, on the dashboard page, none of the icons are visible and the error console reads like this:

Uncaught TypeError: a.widget is not a function
at load-scripts.php?c=0&load[]=hoverIntent,common,admin-bar,wp-ajax-response,jquery-color,wp-lists,quicktags,jquery-query,admin-comments,jquery-ui-core,jquery-&load[]=ui-widget,jquery-ui-mouse,jquery-ui-sortable,postbox,underscore,wp-util,wp-a11y,dashboard,thickbox,plugin-install,updates,shortc&load[]=ode,media-upload,svg-painter,heartbeat,wp-auth-check,wplink,jquery-ui-position,jquery-ui-menu,jquery-ui-autocomplete&ver=4.9.7:300
at load-scripts.php?c=0&load[]=hoverIntent,common,admin-bar,wp-ajax-response,jquery-color,wp-lists,quicktags,jquery-query,admin-comments,jquery-ui-core,jquery-&load[]=ui-widget,jquery-ui-mouse,jquery-ui-sortable,postbox,underscore,wp-util,wp-a11y,dashboard,thickbox,plugin-install,updates,shortc&load[]=ode,media-upload,svg-painter,heartbeat,wp-auth-check,wplink,jquery-ui-position,jquery-ui-menu,jquery-ui-autocomplete&ver=4.9.7:300
at load-scripts.php?c=0&load[]=hoverIntent,common,admin-bar,wp-ajax-response,jquery-color,wp-lists,quicktags,jquery-query,admin-comments,jquery-ui-core,jquery-&load[]=ui-widget,jquery-ui-mouse,jquery-ui-sortable,postbox,underscore,wp-util,wp-a11y,dashboard,thickbox,plugin-install,updates,shortc&load[]=ode,media-upload,svg-painter,heartbeat,wp-auth-check,wplink,jquery-ui-position,jquery-ui-menu,jquery-ui-autocomplete&ver=4.9.7:300

When I look in the network tab in the browser (I've looked in Chrome, Safari, and Firefox, and the host has looked as well), all requests return a 200 status. It does not seem like any requests are being blocked, at least.

If I add SCRIPT_DEBUG=true to the wp-config.php file, all these errors stop and the interface displays as it normally does.

I've been unable to reproduce this issue locally, and my host appears to be unable to tell me what is wrong (although they do see it). What can I tell them to look into, and/or what can I look into?

Update: to be more clear, my suspicion is that this could be a permissions issue on the server. Perhaps the server is unable to concatenate the files as WordPress expects. But the host has been unable to find anything to this effect, and I'm not knowledgeable enough about Linux/file permissions to know what to tell them to look for, or if that is even what is happening.

I have access to a single Linux/Apache server where I'm trying to deploy WordPress. For purposes of this error, I've tested it with the default twentyseventeen theme and all plugins disabled.

When I go to any wp-admin page, logged in as an administrator, most of the icons from the left navigation are missing, checked checkboxes have no checks (for example), and the browser console fills with JavaScript errors.

For example, on the dashboard page, none of the icons are visible and the error console reads like this:

Uncaught TypeError: a.widget is not a function
at load-scripts.php?c=0&load[]=hoverIntent,common,admin-bar,wp-ajax-response,jquery-color,wp-lists,quicktags,jquery-query,admin-comments,jquery-ui-core,jquery-&load[]=ui-widget,jquery-ui-mouse,jquery-ui-sortable,postbox,underscore,wp-util,wp-a11y,dashboard,thickbox,plugin-install,updates,shortc&load[]=ode,media-upload,svg-painter,heartbeat,wp-auth-check,wplink,jquery-ui-position,jquery-ui-menu,jquery-ui-autocomplete&ver=4.9.7:300
at load-scripts.php?c=0&load[]=hoverIntent,common,admin-bar,wp-ajax-response,jquery-color,wp-lists,quicktags,jquery-query,admin-comments,jquery-ui-core,jquery-&load[]=ui-widget,jquery-ui-mouse,jquery-ui-sortable,postbox,underscore,wp-util,wp-a11y,dashboard,thickbox,plugin-install,updates,shortc&load[]=ode,media-upload,svg-painter,heartbeat,wp-auth-check,wplink,jquery-ui-position,jquery-ui-menu,jquery-ui-autocomplete&ver=4.9.7:300
at load-scripts.php?c=0&load[]=hoverIntent,common,admin-bar,wp-ajax-response,jquery-color,wp-lists,quicktags,jquery-query,admin-comments,jquery-ui-core,jquery-&load[]=ui-widget,jquery-ui-mouse,jquery-ui-sortable,postbox,underscore,wp-util,wp-a11y,dashboard,thickbox,plugin-install,updates,shortc&load[]=ode,media-upload,svg-painter,heartbeat,wp-auth-check,wplink,jquery-ui-position,jquery-ui-menu,jquery-ui-autocomplete&ver=4.9.7:300

When I look in the network tab in the browser (I've looked in Chrome, Safari, and Firefox, and the host has looked as well), all requests return a 200 status. It does not seem like any requests are being blocked, at least.

If I add SCRIPT_DEBUG=true to the wp-config.php file, all these errors stop and the interface displays as it normally does.

I've been unable to reproduce this issue locally, and my host appears to be unable to tell me what is wrong (although they do see it). What can I tell them to look into, and/or what can I look into?

Update: to be more clear, my suspicion is that this could be a permissions issue on the server. Perhaps the server is unable to concatenate the files as WordPress expects. But the host has been unable to find anything to this effect, and I'm not knowledgeable enough about Linux/file permissions to know what to tell them to look for, or if that is even what is happening.

Share Improve this question edited Jul 18, 2018 at 16:51 Jonathan Stegall asked Jul 18, 2018 at 13:52 Jonathan StegallJonathan Stegall 2692 silver badges13 bronze badges 4
  • look in the network tab of the browser console to check if all requests are correct. – mmm Commented Jul 18, 2018 at 14:04
  • @mmm I have done this as well, I'll update the question. In any case, all requests return a 200 status. Are you saying there are specific things I should be looking for in the requests? – Jonathan Stegall Commented Jul 18, 2018 at 14:08
  • have you tried on another computer with another browser ? – mmm Commented Jul 18, 2018 at 14:25
  • @mmm yes, I've tried Firefox, Chrome, and Safari on OSX on at least two different computers. Also the host has tried it. – Jonathan Stegall Commented Jul 18, 2018 at 14:32
Add a comment  | 

3 Answers 3

Reset to default 1

Do you load own javascripts into the admin? If i recall correctly, if SCRIPT_DEBUG is set to true, the javascripts are not concenated, but loaded seperately. So if a custom javascript doesn't play well being concenated, this can lead to the whole concenated javascript being corrupt and not being run correctly.

Try removing the added javascripts one by one and check if that changes anything.

The only thing logically different in JavaScript when SCRIPT_DEBUG is set to true vs. false is: when SCRIPT_DEBUG is set to true, main JavaScript source files are being loaded and normally (when SCRIPT_DEBUG is set to false), the minified versions (e.g. file.min.js) are loaded with concatenation & compression.

So apparently, the minified versions of the JS files are causing problems. May be they are even corrupted.

Replace WordPress core with the version from wordpress, may be this will fix the issues.

Note: Don't forget to clear browser cache when you're done doing this, wrong versions may be loaded from the cache otherwise.

I'm experiencing the same issue on the latest Wordpress 5.0.1 but only on /wp-admin/*. Main site renders just fine.

I found defining 'CONCATENATE_SCRIPTS' as false will also solve the issue, which means the minified scripts are actually OK.

Not seeing any permissions issues either. Trying to investigate what exactly happens when scripts are concatenated --

转载请注明原文地址:http://conceptsofalgorithm.com/Algorithm/1749094955a316319.html

最新回复(0)