Open tomjn opened 5 years ago
IIRC this can happen when a plugin deregisters a script very late on in the page load.
Can you narrow down which plugin or theme is causing the error to appear? Does the error appear more than once?
On the frontend of my site it would appear to be jetpack_css
, but that may be due to micro-optimising shenanigans I did
Here's the kludge I tested it with:
protected function dependency_rows( array $handles, WP_Dependencies $dependencies, $label, $type ) {
foreach ( $handles as $handle ) {
$dependency = $dependencies->query( $handle );
if ( is_user_logged_in() ) {
if ( is_bool( $dependency ) ) {
wp_die( 'qm:"'.$handle.'"' );
}
}
list( $src, $host, $source, $local ) = $this->get_dependency_data( $dependency, $dependencies, $type );
if ( is_bool( $dependency ) ) {
continue;
}
This would fix the issue though it would be useful to know that something named jetpack_css
was deregistered
Are you able to try out the develop
branch of QM? I've refactored this entire panel, but the issue might still appear.
hmmm this is in production so I'm not keen on installing node/npm/grunt/etc to build the develop
branch.
To reproduce, I have this mu-plugin:
<?php
add_filter( 'jetpack_implode_frontend_css', '__return_false' );
add_action('wp_print_styles', 'tomjn_filter_scripts', 1000000);
add_action('wp_print_footer_scripts', 'tomjn_filter_scripts', 1000000);
function tomjn_filter_scripts(){
wp_deregister_style('jetpack-widgets');
wp_deregister_style('grunion.css'); // Grunion contact form
wp_dequeue_style( 'jetpack-widget-social-icons-styles' );
wp_dequeue_style( 'jetpack_css' );
wp_deregister_style( 'jetpack_css' );
}
add_action( 'wp_enqueue_scripts', 'crunchify_enqueue_scripts_styles',100000000 );
function crunchify_enqueue_scripts_styles() {
wp_dequeue_script( 'devicepx' );
}
Perhaps deregistering as well as dequeuing was a little overzealous 🤔
You don't need to build anything if you use the develop
branch, the only thing that gets built in QM is the Sass, and that's currently committed directly to the repo too because I know people are using clones of the repo directly.
Thanks for that code block. I imagine the problem lies somewhere among the deregistering and dequeueing - I'll find some time over the next couple of weeks to take a look.
Gonna close this off, please do re-open if you can figure out what caused this or if you can reproduce. Cheers!
Oh wait, I should read my own comments before closing tickets. This is with me.
I'm unsure how this happened but I found it in my error logs, in v3.2.2: