How do I add vConsole.js to Nuxt?
// debugging
import VConsole from "vconsole";
const vConsole = new VConsole();
This causes the error window is not defined
I am stuck... any help very much appreciated.
Thanks!
window
isn’t defined on the server-side. You need to use vConsole as a client side plugin.
plugins/vConsole.client.js
import VConsole from 'vconsole'
Vue.use(VConsole)
Don’t forget to add it to your nuxt.config.js
plugins: { src: '~/plugins/vConsole.client.js' }
thank you!!!!! ` import Vue from 'vue'; import vConsole from 'vconsole'; const vc = new vConsole(); Vue.use(vc); `