Bug in Hubspot collectedforms javascript


#1

Hi, I've got a bug in my javascript on my site, but unfortunately it's being swallowed by the hubspot onerror code which is itself erroring:

collectedforms.js:1 Uncaught TypeError: t.indexOf is not a function
    at n (collectedforms.js:1)
    at HTMLBodyElement.window.onerror (collectedforms.js:1)

The uglified source for the function in your code is:

function n(e, t) {
        if (!t)
            return !1;
        for (var n = 0; n < e.length; n++)
            if (t.indexOf(e[n]) > -1)
                return !0;
        return !1
    }

My site uses jQuery, dataTables and a few other things, in case they're causing a bad interaction.

On this part of the site, all I need is to track page views, but I've not been able to work out if there's a way to do only that using the JS integration. Any ideas?

Thanks!


#2

Hi @ndenny, that's interesting. Can you send over the page that you're seeing this issue on so I can take a look? To track page views you should be able to use this function


#4

Sure, it's happening on our login page (but I can't seem to repro it in Chrome): https://client.apimetrics.io/