Support » Plugin: Lazy Load for Videos » window.llvConfig is undefined and leading to JS errors in v2.10.0

  • Resolved shorelinechrism


    Been using this plugin for a while. The plugin got updated on our website and now there are frontend javascript errors. The errors are:

    Uncaught TypeError: Cannot read property 'youtube' of undefined

    Uncaught TypeError: Cannot read property 'vimeo' of undefined

    I’ve checked my console and it seems that window.llvConfig is not on the page. I am not using any caching plugins outside of the WPEngine baked in caching. I am doing some optimization of assets manually by using CSS preload and async on most scripts on the site, but when I remove that functionality, the error is still present.

    The error occurs somewhere between v2.8.7 and v2.10.0. What’s even weirder is that I cannot test any releases between those versions. In wp-cli I try to update the plugin and use specific versions and it can’t find any release in between those versions. I don’t have a ton of time to diagnose this issue and have reverted the plugin to v2.8.7 and froze the version by manually changing to v9999 (shudder, I know.)

    Maybe somewhere in your webpack revamp, the window.llvConfig object got misplaced. I am running WP v5.4.2 in a multisite environment on WPEngine running PHP 7.3.

Viewing 3 replies - 1 through 3 (of 3 total)
  • I think this has something to do with wp_add_inline_script and something custom on my multisite setup where we try to optimize the JS using the script_loader_tag function. I have resolved this issue as it is likely only affecting this one site. Apologies.

    Plugin Author kevinweber


    Interesting… Are you async-loading your JavaScript? Is there a chance that your site is blocking inline JavaScript? You should find the string “window.llvConfig=window.llvConfig||{};” in your HTML whenever the Youtube JavaScript file is being loaded. That string should be placed immediately in front of the script tag because, as you said, I’m using wp_add_inline_script since v2.9.

    Plugin Author kevinweber


    If you can figure out a generic fix, I’d love to merge your pull request. You can contribute here:

    • This reply was modified 2 months, 3 weeks ago by kevinweber.
Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.