Skip to content

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

Closed

Description

@SeniorSpielbergo

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

Activity

  1. swissspidy commented on Jul 1, 2019

    @swissspidy
    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.

  2. SeniorSpielbergo commented on Jul 2, 2019

    @SeniorSpielbergo
    Author

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

  3. ehti commented on Apr 2, 2020

    @ehti
    Member

    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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Needs TestingNeeds further testing to be confirmed.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions