Support » Plugin: WP Scroll Depth » jQuery.scrollDepth is not a function console error

Viewing 9 replies - 1 through 9 (of 9 total)
  • Sorry for the delay.
    Is this first-time install of the plugin?
    How are you implementing Google Analytics?
    (Old _ga() snippet, Google Tag Manager, Universal Analytics, or the new gtag tracking snippet?)
    Are there other JavaScript errors earlier in the log that might be preventing scrollDepth from loading?

    Yes, first-time install (on this site – I’ve used it for other clients previously).

    Using Genesis so Analytics code is added into the header in the Genesis settings.

    Using the new gtag tracking as the analytics account was just set up today.

    No other JS errors in the console.

    Here’s the full error readout:
    Uncaught TypeError: jQuery.scrollDepth is not a function
    at HTMLDocument.<anonymous> ((index):189)
    at i (jquery.js?ver=1.12.4:2)
    at Object.fireWith [as resolveWith] (jquery.js?ver=1.12.4:2)
    at Function.ready (jquery.js?ver=1.12.4:2)
    at HTMLDocument.K (jquery.js?ver=1.12.4:2)

    I tried adding a plugin to update the jquery version, but that didn’t help either.

    I just tried it on my gtag test install (manually added snippet to theme) and it seems to be firing events.
    I AM seeing a weird warning from the current gtag code, but everything seems to be working.

    In your case, it looks like the wp_scroll_depth_head is firing and putting the initialization in there.
    Since we’re not getting an error on the jQuery( document ).ready() it would seem that jQuery is loaded in time for this be called.

    If you watch the Network tab, does the page try to load js/jquery-scrolldepth/jquery.scrolldepth.min.js ?

    Oh… are you logged in by chance when this error fires? It’s possible my check for is_admin is not correctly implemented.

    I did a little reading on Genesis Framework scripts and it’s very possible the theme doesn’t like the initialization in the <head>.

    If you’re comfortable editing code to test something, you could try changing the add_action("wp_head", "wp_scroll_depth_head"); (around line 187) with
    add_action("wp_footer", "wp_scroll_depth_head", 99);

    If that solves your issue, I don’t have a problem pushing it into the main release – most modern themes should be OK with that.

    Nope that didn’t work.

    Network tab does show it’s loading jquery.scrolldepth.min.js just fine.

    I’m wondering if it’s a plugin conflict? I can test, but I’ll have to duplicate the site on a staging server.

    Plugin Contributor lonkoenig

    (@lonkoenig)

    Sorry this is dragging out.
    Do you have any likely suspects for conflicts?
    If they are free plugins, I can probably install them on one of my testing instances.

    Plugin Contributor lonkoenig

    (@lonkoenig)

    Just saw this on one of our dev sites. Of course, I don’t know which plugin is conflicting yet either. 🙂
    Are you running WooCommerce?

    Hi again!

    I put this on the backburner for now, but I do want to get it working.

    We aren’t running Woo.

    Plugin Contributor lonkoenig

    (@lonkoenig)

    I thought I’d dive into the instance I’m seeing. And this is super-weird.
    WP ScrollDepth plugin isn’t installed.

    Probably doesn’t apply to your case, but it’s interesting enough to share.

    Plugin Contributor lonkoenig

    (@lonkoenig)

    nevermind. Was just some sloppy cut-and-paste on my end 🙂

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘jQuery.scrollDepth is not a function console error’ is closed to new replies.