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

Importing it in nuxt error #28

Open
Hamdan85 opened this issue Jul 2, 2018 · 2 comments
Open

Importing it in nuxt error #28

Hamdan85 opened this issue Jul 2, 2018 · 2 comments

Comments

@Hamdan85
Copy link

Hamdan85 commented Jul 2, 2018

Impossible to import it as plugin in nuxt:
import Toast from 'vue-easy-toast'
Vue.use(Toast);

document is not defined

@noru
Copy link
Owner

noru commented Jul 2, 2018

Hey thanks for the report!

I have zero experience with nuxt, but this error is not a surprise. I think it should be shimmed somehow as this suggested.

I'm willing to do so but how can I verify it on your behalf? Would you please provide me a simple build & run project so I can make sure it indeed works?

@noureddinenoureddine
Copy link

you should disable ssr for this plugin
in you nuxt.config.js

plugins: [
    // ...
    { src: '~/plugins/toast', mode: 'client' },
  ],

more info: https://nuxtjs.org/guide/plugins/#client-side-only

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants