CMS Development

derekcavaliero
Contributeur de premier rang | Partenaire solutions Diamond
Contributeur de premier rang | Partenaire solutions Diamond

Embedded HubSpot Forms Throwing 400 (Bad Request) Error

I've noticed that for whatever reason the hbspt.forms.create method is throwing a 400 error whenever I embed a form.

 

The request is to fonts.google.com - which shouldn't be happening anyways - I have all the form styling options disabled on the form.

 

Screen Shot 2019-02-05 at 7.55.19 AM.png

 

This also only seems to happen on HubSpot COS/CMS pages.

 

Can you shed some light here? When the form styles and css options are removed from my form embed codes and settings I expect them to not attempt to load extra overhead for styling purposes.

Derek Cavaliero
Director of Engineering

WebMechanix
www.webmechanix.com
0 Votes
4 Réponses
lhaith
Contributeur

Embedded HubSpot Forms Throwing 400 (Bad Request) Error

i can confirm the same behavior on our hubspot landing pages and whenever we embed hubspot forms onto our website. Did you get any feedback before i open an new issue with technical?

0 Votes
derekcavaliero
Contributeur de premier rang | Partenaire solutions Diamond
Contributeur de premier rang | Partenaire solutions Diamond

Embedded HubSpot Forms Throwing 400 (Bad Request) Error

@lhaith 

 

I didn't have time to wait to resolve the issue with a support ticket but I did come up with a (hacky) solution that fixes it.

 

The code below will override the method that is responsible for outputting the HubSpot form CSS (and in this case the external request to Google Fonts). This would need to be placed after the forms library, but BEFORE your HubSpot Embed Code. 

 

<script>
hubspot.utils.injectCss = function() { return false; };
</script>

I intend to open up a support ticket if I see the issue happening again during my next LP build.

Derek Cavaliero
Director of Engineering

WebMechanix
www.webmechanix.com
0 Votes
lhaith
Contributeur

Embedded HubSpot Forms Throwing 400 (Bad Request) Error

@derekcavaliero 

 

Hopefully you get somewhere with that ticket. Thanks for sharing the temporary solution. i'll get our developer on it straight away. Smiley heureux

0 Votes
jennysowyrda
Gestionnaire de communauté
Gestionnaire de communauté

Embedded HubSpot Forms Throwing 400 (Bad Request) Error

Hi @derekcavaliero,

 

Have you reached out to HubSpot Technical Support regarding this? If you are seeing something that is not working as expected, I would recommend reaching out to Support, as that will be the most direct way to resolve this issue in your portal.

 

Thank you,
Jenny

0 Votes