Viewing 11 replies - 1 through 11 (of 11 total)
  • Unfortunately the same is happening for me. After updating to 6.2.1 version, we have this error:

    (index):140 Uncaught ReferenceError: ewww_webp_supported is not defined

    The involved script should be:

    <script>if(ewww_webp_supported){document.body.classList.add("webp-support");}</script>

    I am facing a similar issue:

    “Uncaught ReferenceError: ewww_webp_supported is not defined
    at (index):162”

    “Uncaught ReferenceError: ewww_webp_supported is not defined
    at VM18:162”
    etc.

    https://www.vinaet.de

    It started after wordpress introduced webp support in my case.

    I am using ewww via wp rocket.

    Please, try to resolve that issue as it may have a negative impact on google reankings as well as on page indexing in my experience.

    Plugin Author nosilver4u

    (@nosilver4u)

    If you have WP Rocket, it’s connected to their Delayed JS feature. They will have the WebP script excluded by default in the next release. In the meantime, you may manually add “ewww_webp” to the WP Rocket exclusions to work around it for now.

    If you don’t have WP Rocket, make sure you do not have anything combining inline JS with external JS files (like Autoptimize).

    Thread Starter andrewceharris

    (@andrewceharris)

    @nosilver4u Autoptimize hasn’t been set to inline any JS or optimize the JS on my site, although i do use it for CSS.

    We did recently upgrade to the latest WordPress version with webp support.

    Even after disabling Autoptimize and every other performance plugin on our testing site, the error still shows for us.

    If i re-enable “JS-WebP-Rewriting” in the settings, the error disappears. However, i’d like to avoid additional JS on the frontend, as we use Cloudflare for full page caching, we can let the server handle that so i was just using the picture rewrite.

    Maybe this class exists even when it’s disabled

    
    // class-eio-lazy-load.php line 289
    // If JS WebP isn't running, set ewww_webp_supported to false so we have something defined.
    if ( ! class_exists( 'EIO_JS_Webp' ) ) {
    	$body_tags = $this->get_elements_from_html( $buffer, 'body' );
    	if ( $this->is_iterable( $body_tags ) && ! empty( $body_tags[0] ) && false !== strpos( $body_tags[0], '<body' ) ) {
    		$body_webp_script = '<script>var ewww_webp_supported=false;</script>';
    		// Add the WebP script right after the opening tag.
    		$buffer = str_replace( $body_tags[0], $body_tags[0] . "\n" . $body_webp_script, $buffer );
    	}
    }
    Plugin Author nosilver4u

    (@nosilver4u)

    @andrewceharris I couldn’t remember the other error case we had until I was looking at your site, and noticed that the <body> tag had no attributes or classes at all. That’s a bug we fixed last week, but haven’t released yet. You can grab it early via our GitHub repo if you like: https://docs.ewww.io/article/73-update-from-github

    Also, for anyone using Lazy Load without JS WebP, the latest code includes a fix for similar issues introduced by script merging/combining.

    I am facing similar issues as Andrew does. Autoptimized is not installed. And, I added ewww_webp to the Java Script exceptions of WP Rocket (standard, delay, execution, all three). The latest WP Rocket Update did not fix it for me as well.

    I am also using Perfmatters and Asset CleanUp.

    Should I add the exception to Lazy Load maybe?

    Plugin Author nosilver4u

    (@nosilver4u)

    @mexxez I’d have to see your page to have a better idea, but if the exclusion didn’t fix the problem for you, then you’ll probably need the latest code from GitHub.

    I will give a try or I will wait for your next update.

    hello i have the same error, i use wp rocket and ewww
    what is the solution ?

    Plugin Author nosilver4u

    (@nosilver4u)

    @yberges
    The solution depends on what problem you are experiencing on your site. The error could result from one of three things:
    1. A plugin like WP Rocket loading the JS WebP scripts asynchronously. In that case, one can usually resolve it by adding “ewww_webp” to the exclusions in said plugin. If you’re not sure where to add the exclusion, you would need to consult with their support for assistance.
    2. Using an outdated version of the EWWW IO lazy loader where the ewww_webp_supported code has not been added to the page. So update to the latest version ??
    3. Or using the EWWW IO lazy loader on a site where async loading has messed up the ordering of scripts. An update should also resolve this, as the lazy loader in 6.2.3 should never throw said error even when the inline (ewww_webp_supported) script is tampered with (or missing).

    1 i will check
    2 – 3 its already the last version 6.2.3
    no sure to understand solution

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Uncaught ReferenceError: ewww_webp_supported is not defined’ is closed to new replies.