Back to All

Chatbot Init gives error on page refresh

Hi! I am injecting the Init script as dynamic scripts in my Vue app, the client gave me two script tags, the first one is:

The second one (window.sntchChat.Init(id)) seems to not wait until the first one loads, because the chatbot doesn't initialize and I have this error: "Uncaught TypeError: Cannot read property 'Init' of undefined".
This is beacuse in that moment the window.sntchChat is undefined, but if I call the second script ulteriorly from the console, it works. I've already tried to defer the second script, but the same issue.

Did somebody meet this error and could resolve it?

Thanks, Krisztina