eolant / vuetify-toast-snackbar

Basic Vue toast service that uses Vuetify Snackbar component.
MIT License
128 stars 36 forks source link

Error in nextTick: "ReferenceError: document is not defined" #2

Closed jb-reynaud closed 5 years ago

jb-reynaud commented 5 years ago

There is an error poping using this library:

Error in nextTick: "ReferenceError: document is not defined" 
document is not defined

Which refere to this line of code https://github.com/eolant/vuetify-toast-snackbar/blob/master/src/index.js#L10

should we check if document is defined before? as it works, it's just an annoying warning

eolant commented 5 years ago

Thanks for posting this. Can you please check doc example and see if you have the same issue there? document is a global variable and should be available there in the browser context. Can you please provide more details on your setup and libraries and versions used as well as the browser with version where you see the error.

eolant commented 5 years ago

Closing due to lack of activity.

mrcndn commented 4 years ago

This happens during nuxt's server rendering.

Following workaround resolved my issue,

if (process.client) { this.$toast('Default toast'); }

eolant commented 4 years ago

@mrcndn thanks. Also If using Nuxt it's possible to specify client only plugin.