CMS Development

Malvin_j
Membro

LeadFlow Errors

Hello community, I've facing this issue on my nextjs app and it's causing my app to break when this console error pops up. Any help available?


leadflows.js:1 Uncaught TypeError: t.report is not a function
at Object.getPortalId (leadflows.js:1)
at Object.setUpErrorReporting (leadflows.js:11)
at Object.setUp (leadflows.js:11)
at a (leadflows.js:11)
at leadflows.js:11
at leadflows.js:11

14 Respostas 14
ImanGM
Membro

LeadFlow Errors

Hey! Are you using <Head>{scripts}</Head> from 'next/document' in your _document.js to load Hubspot javascript integration codes?

 

If so, move the codes that you have there to _app.js using <Head /> from 'next/head'. In _document.js keep only the <Head />

 

It will most probably fix the error.

0 Avaliação positiva
nop1984
Membro

LeadFlow Errors

this makes even worst: if before error was appearing after navigating to any SPA page, now it appears always including first load of app

0 Avaliação positiva
AG-Force
Participante

LeadFlow Errors

I too see this exact error occurring frequently with a website that is delivered using nextjs.  

0 Avaliação positiva
CSchratz
Membro

LeadFlow Errors

Any update to this issue? I'm encountering the same problem. Building a Next.js Project that utilizes Hubspot forms. Doesn't seem to be much information out there besides this single thread. Any advice would be appreciated.

0 Avaliação positiva
nstoffel
Participante

LeadFlow Errors

Same problem here - on Nuxt site - (Nuxt is like Nextjs but for vue 😉 )

 

nstoffel_0-1669828870558.png

 

Here's my component:

 

nstoffel_1-1669828963483.png

 

 

0 Avaliação positiva
simonwidjaja
Participante

LeadFlow Errors

Same problem here with nextjs. Any updates or solutions? This is a road blocker for me right now 😞 Any help highly appreciated.

thanks

0 Avaliação positiva
MMerino
Participante

LeadFlow Errors

Facing the same issue with Next.js as well.

unable to find anything else related to this issue besides hubspot. does anyone have an update to this or a way to disable these messages? 

 

thank you! 

william_
Membro

LeadFlow Errors

Hey, 

I'm also facing the same issue on a Next.js project with an integration to HubSpot API:

t.report is not a function. (In 't.report(e,{"hs-sf-metric":"noPortalId"})', 't.report' is undefined)

TypeError Object.getPortalId(leadflows)


Any news on this issue? 

DBolles
Membro

LeadFlow Errors

I am receiving this same issue when integrating the HubSpot JS file into a NextJS website 😕

 

I get two errors:

 

Cannot read property 'reportCount' of undefined

O.analyticsReporter is undefined

 

I'm temporarily using the HubSpot API to create contacts from my website but would perfer to use the JS script

dennisedson
Equipe de Produto da HubSpot
Equipe de Produto da HubSpot

LeadFlow Errors

@Malvin_j , did you make any progress with this 😬

0 Avaliação positiva
Haymez
Participante

LeadFlow Errors

We are having a similiar issue with our Nextjs project. I keep getting "Cannot read property reportCount of undefined" bugs which cause an error overlay to appear. This causes local development to be very annoying. Any tips on how to prevent that error from occuring would be great 

0 Avaliação positiva
dennisedson
Equipe de Produto da HubSpot
Equipe de Produto da HubSpot

LeadFlow Errors

Hey @Malvin_j 

Sorry you are having this issue.  Do you have any more details that you can provide? 

@stefen, @malcolm1  have you seen this happen before?

0 Avaliação positiva
Malvin_j
Membro

LeadFlow Errors

Yes! I do get these errors after I successfully subscribe as a lead.

At first, I suspected the inclusion of reCAPTCHA on the contact form so I took it off but there was no luck. 
Currently I'm including the tracking code as a header script tag in nextjs and maybe that could also be the issue but I'm not too sure as it works very fine until I ( or any user) subscribes via the contact form then the issues starts occuring.

 

In conclusion, I would like to know if there's an alternative solution of implementing hubspot integration in a webapp apart from using the script tag. Thank you.

 

0 Avaliação positiva
stefen
Conselheiro(a) de destaque | Parceiro
Conselheiro(a) de destaque | Parceiro

LeadFlow Errors

@dennisedson @Malvin_j that's a new one for me. But, I also don't have much nextjs experience. I wonder if it's trying to codesplit the 3rd party hubspot script?

Stefen Phelps, Community Champion, Kelp Web Developer