apertureless/vue-parallax

Error in beforeCreate hook because of reference to local file

niklashof opened this issue · 1 comments

The current version throws an error:

[Vue warn]: Error in beforeCreate hook: "ReferenceError: document is not defined"

This happens because there is a local file referenced:

at /Users/jjuszczak/Projekte/Privat/vue-parallax/src/components/Parallax.vue

line 3037:

beforeCreate: [_t], __file: "/Users/jjuszczak/Projekte/Privat/vue-parallax/src/components/Parallax.vue"

Environment

  • vue-parallax version: 1.0.4

Are you using it in a ssr environment? Like nuxt ?
You need to add it as a plugin and then disable ssr for it.

As document and window are not defined on server side.

https://nuxtjs.org/guide/plugins/#client-side-only

#17