Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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 join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants