Skip to content
This repository was archived by the owner on Feb 20, 2025. It is now read-only.

window.zE ist not a function #34

Open
simonmaass opened this issue Aug 12, 2021 · 2 comments
Open

window.zE ist not a function #34

simonmaass opened this issue Aug 12, 2021 · 2 comments

Comments

@simonmaass
Copy link

We are seeing some errors in sentry in the "onload" part:

TypeError: window.zE is not a function
  at HTMLScriptElement.n.onload(./node_modules/@dansmaculotte/vue-zendesk/src/index.js:47:16)
@rtouze
Copy link
Contributor

rtouze commented Aug 20, 2021

Can you give me more details about the browser you use and the options set for the plugin? I cannot reproduce the error you're facing.
This call is performed in onload callback, so I don't see why window.zE wouldn't be defined.
Did you check your Zendek key? Are your sure you can load the widget with a simple <script> tag?

@mirocklez
Copy link

@simonmaass - I guess you're using Nuxt or some kind of SSR for your app?
If Nuxt, when you add the plugin to your nuxt.config.js, you should register it as client plugin only like this:

plugins: [
   '~/plugins/foo.client.js', // only in client side
  ...
]

or like this:

plugins: [
  { src: '~/plugins/client-only.js', mode: 'client' }, // only on client side
  ...
]

With this settings you should not experience any error like the one you describe.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

3 participants