Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Site is Experiencing a Technical Issue in lib/client-assets.php file #16360

Closed
SeniorSpielbergo opened this issue Jun 29, 2019 · 3 comments
Closed
Labels
Needs Testing Needs further testing to be confirmed.

Comments

@SeniorSpielbergo
Copy link

SeniorSpielbergo commented Jun 29, 2019

Describe the bug
There seems to be a bug in the client-assets.php file.

To reproduce
Actually, I am not sure how to reproduce this as I only received an email by my WordPress installation informing me that:

Since WordPress 5.2 there is a built-in feature that detects when a plugin or theme causes a fatal error on your site, and notifies you with this automated email.

In this case, WordPress caught an error with one of your plugins, Gutenberg.

...

Error Details

An error of type E_ERROR was caused in line 58 of the file /.../httpdocs/wp-content/plugins/gutenberg/lib/client-assets.php. Error message: Uncaught Error: Call to a member function query() on null in /.../httpdocs/wp-content/plugins/gutenberg/lib/client-assets.php:58
Stack trace:
#0 /.../httpdocs/wp-content/plugins/gutenberg/lib/client-assets.php(539): gutenberg_override_script('react', 'https://www.dav...', Array, NULL)
#1 /.../httpdocs/wp-content/plugins/gutenberg/lib/client-assets.php(435): gutenberg_register_vendor_script('react', 'https://unpkg.c...', Array)
#2 /.../httpdocs/wp-content/plugins/gutenberg/lib/client-assets.php(230): gutenberg_register_vendor_scripts()
#3 /.../httpdocs/wp-includes/class-wp-hook.php(286): gutenberg_register_scripts_and_styles('')
#4 /.../httpdocs/wp-includes/class-wp-hook.php(310): WP_Hook->apply_filters('', Array)
#5 /...

When looking at my homepage, I was not able to see any problems, but as I received this email for the sixth time within a few weeks (using different versions of Gutenberg), I wanted to report this issue.

Expected behavior
I would expect that no such error messages occur.

Desktop (please complete the following information):

  • OS: Windows 10
  • Browser: Firefox
  • Version: 67.0.4. 64 bit

Additional context

  • Gutenberg Version: 5.8, 5.9, 6.0
@swissspidy swissspidy added Needs Tests Needs Testing Needs further testing to be confirmed. and removed Needs Tests labels Jul 1, 2019
@swissspidy
Copy link
Member

Here's the code in question:

function gutenberg_override_script( $handle, $src, $deps = array(), $ver = false, $in_footer = false ) {
global $wp_scripts;
$script = $wp_scripts->query( $handle, 'registered' );

Given that this code runs on wp_enqueue_scripts / admin_enqueue_scripts, $wp_scripts should be available there.

To me that sounds more like a bug caused by some other plugin that accidentally removes that global variable.

I guess the code could first check whether the object is there, but that would also mean papering over an actual issue on the site.

@SeniorSpielbergo
Copy link
Author

SeniorSpielbergo commented Jul 2, 2019

@swissspidy What would you recommend? Is there a way for me to support you / identify which plug-in might be causing this issue?

Also might this be related to #15829?

@ehti
Copy link

ehti commented Apr 2, 2020

Hi @SeniorSpielbergo,

We discussed this in editor triage and couldn't really figure out how to reproduce this. Haven't seen this before either.

For now closing this, but if you're able to reproduce this after disabling all the plugins (preferably a fresh install), let us know and some steps to reproduce as well.

Thank you!

@ehti ehti closed this as completed Apr 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Testing Needs further testing to be confirmed.
Projects
None yet
Development

No branches or pull requests

3 participants