vue-ellipse-progress: 'document is not defined' when using with nuxt.js
I’m trying to use this with nuxt.js I made a plugin file with the following content:
import Vue from 'vue'
import VueEllipseProgress from 'vue-ellipse-progress'
Vue.use(VueEllipseProgress)
and get the document is not defined error.
I’ve tried putting it in <client-only> tag but still getting the same error.
Any fix?
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 19 (10 by maintainers)
@alitnk
Confirmed. I tried to follow the official Nuxt guide for plugins, But that did not work:
Although the error disappears, another error
Unknown custom element: <vue-ellipse-progress>appears instead. I am not a Nuxt expert and have tried all possible options found, but without success.The error has only to do with Vue Build and Nuxt, not with the source code. I need to invest more time in this, any help is much appricated.EDIT
I finally found an older Nuxt project where i originally tested the component, with the same config as above, latest
v1.3.0with Nuxt2.15.3, works just fine! So, the problem is to find correct config and tell Nuxt that the lib must be used only on the client sideYou can call plugin in mouted. Template
Script