APIs & Integrations

GurpiyarSingh
Member

Integrating Bot with website locally.

Hello,

 

I have created a testing bot here. To test it, i write a simple html code and build a html page with tracking code inside the body as instructed. But it is not working.

 

Is it necessary to have a launched website. Can't we test it locally ????

0 Upvotes
5 Replies 5
PTamrakar
Participant

Integrating Bot with website locally.

Hi @cbarley 

So you are telling hubspot the great do not care about developers and thats why from 3 year no improvement ?

0 Upvotes
cbarley
HubSpot Alumni
HubSpot Alumni

Integrating Bot with website locally.

Hi @GurpiyarSingh , it's not possible to use bots locally yet. It's a feature that has been requested in the past and something our team is looking into, but with no timeframe as of yet. A few workarounds:

DKepple
Member

Integrating Bot with website locally.

I'd love for this to be easier to implement for local development.  I first tried the ngrok approach, as I've had a good experience in the past with it, but am getting this warning:

 

Warning: Prop `id` did not match. Server: "cookieBanner-6718527" Client: "hs-script-loader"

 

Which is followed by this (presumably) downstream error:

 

Uncaught TypeError: Cannot read properties of null (reading 'getAttribute')
    at n (VM2146 conversations-embed.js:1:59705)
    at new u (VM2146 conversations-embed.js:1:69750)
    at b (VM2146 conversations-embed.js:1:2754)
    at HTMLDocument.n (VM2146 conversations-embed.js:1:1356)

 

And the chatbot does not appear on the page.

It looks like some styles get injected into the body, but I don't see the iframe

Has ngrok been confirmed to work as a solution for local dev + chatbot?

 

So I tried editing the host file.  Again, not working, although I must admit the "instructions" given here are a little lacking. Am I supposed to point my production URL to 127.0.0.1?  But I think the problem this is SSL; Chrome redirects `http` to `https` and of course my local server doesn't have a certificate... I've tried to set one up in the past and it's very cumbersome. Tried Firefox and it's also very strict on the https thing. I've looked up workarounds, and, well, I've spent two days trying to get one of these solutions to work and I'm fed up.

 

I was about to try the heroku option (if only because it seemed quicker than deploying though my company's normal CI/CD process, only to realize that that would be cumbersome, as well, as logging in involves some a redirect to a separate app...it's just way too much effort for something that, in my opinion, should just work out-of-the-box from HubSpot.

0 Upvotes
DKepple
Member

Integrating Bot with website locally.

A little more elbow grease and I got the hostfile thing to work... but I'm still getting the `document.getElementById('hubspot-messages-loader')` error. I believe this is the same as the error mentioned previously, only it's from Firefox and not Chrome, so different wording. It happens at the same spot in the source code.

0 Upvotes
HBocquet
Member

Integrating Bot with website locally.

Hello! Did you find a solution to this issue? I'm getting the same error.

I am using an inline embedded plugin and trying to load it only when clicking a button.

0 Upvotes