window is not defined - nuxt.js ssr

This issue has been tracked since 2021-06-07.

image

I tried with <client-only> tag - didn't work
Also tried Vue.extend(VueDragResize) - dint work

Following line causes issue

import VueDragResize from 'vue-drag-resize'
aurhell wrote this answer on 2021-10-25

You need to precise mode: 'client' in your nuxt.config


Please try these steps to make it work:

  1. create a plugin (mine is called draggable)
import Vue from 'vue'
import VueDragResize from 'vue-drag-resize'

// eslint-disable-next-line vue/component-definition-name-casing
Vue.component('vue-drag-resize', VueDragResize)
  1. then in your nuxt.config, in your plugins definition
{
    src: '~plugins/draggable',
    mode: 'client',
},

should be OK 😉

More Details About Repo
Owner Name kirillmurashov
Repo Name vue-drag-resize
Full Name kirillmurashov/vue-drag-resize
Language JavaScript
Created Date 2018-04-26
Updated Date 2022-11-25
Star Count 1764
Watcher Count 24
Fork Count 291
Issue Count 89

YOU MAY BE INTERESTED

Issue Title Created Date Updated Date