1

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.

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? 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. Commented Jul 18, 2018 at 14:32

3 Answers 3

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.

3
  • The thing is, I've tested this with the default twentyseventeen theme, and with all plugins disabled. That is, the default WordPress behavior when it is first downloaded. I don't think this can be the issue, since WordPress doesn't normally behave this way. Commented Jul 18, 2018 at 14:45
  • Maybe one of the javascripts got corrupted while transferring to your server. You can try overwriting the wp-admin and wp-includes folder with new versions. Commented Jul 18, 2018 at 14:48
  • thanks, I've tried this. I've run wp core download --skip-content --force on the server, which overwrites wp-admin and wp-includes with the versions from wordpress.org. Commented Jul 18, 2018 at 14:55
1

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.org, 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.

4
  • Yes, I've tried this. I've run wp core download --skip-content --force on the server, which overwrites wp-admin and wp-includes. Commented Jul 18, 2018 at 14:54
  • Did you check PHP error log?
    – Fayaz
    Commented Jul 18, 2018 at 15:02
  • Yes, they are currently empty, even if WP_DEBUG itself is set to true. Commented Jul 18, 2018 at 15:32
  • In that case, without the access to your server, it's really difficult to tell what's going on under the hood. You better employ a WP + Linux Server expert to check the issue. Generally speaking, for concatenation, PHP only needs read access to those files.
    – Fayaz
    Commented Jul 18, 2018 at 16:04
0

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 --

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.