akulubala / vue-product-zoomer

Zoom Prodct Image, useful for e-shop website

Home Page:http://www.yoohooworld.com/demo.html

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

gridsome build fails

tobkle opened this issue · comments

Adding vue-product-zoomer to Gridsome works during gridsome develop, but it fails during gridsome build (node v8.11.0/v10.16.0) while server side rendering (SSR) with the error:

Failed to render /examples/product
ReferenceError: window is not defined
    at Object.465 (node_modules/vue-product-zoomer/dist/assets/js/app.bundle.js:1:206)
    at __webpack_require__ (webpack/bootstrap:25:0)
    at Module.523 (assets/js/page--src--pages--examples--product-vue.f579c5f2.js:113:18)
    at __webpack_require__ (webpack/bootstrap:25:0)
    at <anonymous>
gridsome build  34.41s user 2.34s system 149% cpu 24.610 total

Is there a work-around for server rendered pages, that this window is not referenced?
Sounds similiar like the nuxt issue. Don't know to handle it with gridsome.

Hi, this problem is cased using SSR mode, will be fixed for next release

You are working on the next release?

For Nuxt SSR mode it works fine, check the example Nuxt project, this plugin only works for client side project. need to disable SSR: https://nuxtjs.org/guide/plugins