Kylart / KawAnime

Desktop app for anime fans
MIT License
664 stars 50 forks source link

500 | Internal Server Error ReferenceError: window is not defined #57

Closed bajki closed 5 years ago

bajki commented 5 years ago

Hi i want to use vuex-persistedstate but im getting this error.

500 | Internal Server Error ReferenceError: window is not defined at module.exports (KawAnime-master/node_modules/vuex-persistedstate/dist/vuex-persistedstate.js:1:398)

Is there any fix for this?

Kylart commented 5 years ago

KawAnime is a server-side rendered app, similar to how a nuxt app is working. Thus, in the server context, window is not defined and you get this error.

You can fix that by doing something similar to this file.

let Velocity = null

if (typeof window !== 'undefined') Velocity = require('velocity-animate').default