Hi!
We use a hubspot form in our Next.js web page. It works fine for Chrome and Edge, but it is struggling for Firefox. Specifically, it takes 10 seconds for the form to load. This lag does not happen all the time, but still quite often. From the illustration below, the request is blocked for 10 seconds. This is our page: https://www.glintsolar.ai (to open the form, scroll to the bottom and press “Get in touch”).
Is there anything we can do on our side to avoid this bug? For instance, what are the best practices for implementing the form on a Next.js web app?
I have also looked into form submission through your API, but it looks like you only have legacy APIs that support this (I am here referring to https://legacydocs.hubspot.com/docs/methods/forms/submit_form). In any case, which API would you recommend to use for form submission?
The ideal would for us would be to use the out of the box native form we can implement in our web app, but this needs to be bug free (i.e without lag).
Hey @fredrbl Just tested this on on the latest version of firefox on Mac ventura, Mojave, Ubuntu and Windows 10 and 11 and am seeing maybe a split second of loading time for the form, which I would attribute to how your pop-up is setup. Definitely not 10s. What version of FF are you seeing this on?
It does look like you’re not triggering the forms.create script until the button is clicked, would you consider loading the forms create script on load and then only displaying it when the button is clicked? This would likely make any loading issues invisible.
Regarding the API, honestly they’re just “legacy” because the dev docs updated and the forms team have been too busy to update the submissions api documentation to suit the new format, they won’t be discontinued any time soon, I’d be very shocked if they ever got discontinued without a replacement.
Hey @TomM2 , thanks for swift response!
Yeah, it does not happen all the time as I said. Happened more when I cleared the cache, then it happened like one time every 3th attempt. I use Firefox 116 (developer edition, maybe this has something to say)
Good idea! I’ll load it on page load, then I am safe.
Ok, thats nice to know! Then I will use this API (if not here, then other places). Thanks! All good now then.
@fredrbl I’m definitely seeing a 1 or 2 second load time in developer edition there to be honest! My guess is it’s doing a bit more processing of the scripts.
I know in the latest public release around 115 it’s loading with a >1 second load on my machine.
I think pushing the forms.create on page load would definitely be your best bet though! I know forms.create isn’t really designed to be called on the fly, particularly so far after v2.js, just on load, so this is likely where you’re seeing issues from!