Ricerche recenti


Nessuna ricerca recente

Method messenger:on.close does not exist and Method messenger:on.open does not exist.



Data ultimo post: 13 apr 2023

Hello, we use zendesk web widget (classic) and last time we got errors in our console: Method messenger:on.close does not exist and Method messenger:on.open does not exist, but we don't use this api methods (only webWidget api methods).

As far as I understand, errors occur at the time of loading the script, we use this code for it 

const s = document.createElement('script');
s.src =
'https://static.zdassets.com/ekr/snippet.js?key=key';
s.id = id;
s.defer = true;
s.async = false;
s.onload = (): void => resolve();
s.onerror = (): void => reject();
document.body.append(s);

I would be grateful if someone could help me with the problem


0

2

2 commenti

This issue is driving me nuts! I've moved to messenger from the classic webWidget and get this same error. I've tried several solutions to no avail. Copied and pasted from Zendesk admin and added additional script to satisfy the error. This is what I get for moving to Messenger too soon, huh?

 


// MESSENGER CLOSE
zE('messenger','close')
{
console.log("this is crap");
}

// WEBWIDGET CLOSE - JUST TO SHUT UP THE ERROR
zE('webWidget:on','close')
{
console.log("deprecated");
}
 
// WHAT THE HELL???
zE('webWidget','close')
{
console.log("deprecated? this is crap");
}

</script>

0


image avatar

Tipene Hughes

Zendesk Developer Advocacy

Hey Jeremy,

This error is most commonly shown when you are calling methods that are NOT associated with the web widget you are using - in other words, if you're calling classic web widget APIs when the script + key for a messaging web widget has been provided, and vice versa. 

So we can cover all bases, can you double check that you have enabled messaging for your web widget. Here's a link on how to do that:

https://support.zendesk.com/hc/en-us/articles/4408827701530-Getting-started-with-messaging-for-web-and-mobile

If everything is configured correctly and you're still seeing these errors, let me know and I can pull this in to a private ticket and take a look at your code in more detail. 

Thanks,

Tipene

0


Accedi per aggiungere un commento.

Non hai trovato quello che cerchi?

Nuovo post