adrienhobbs / vue-lazyload-video

A set of Vue components for lazy-loading videos into the DOM.
https://adrienhobbs.github.io/vue-lazyload-video/
4 stars 3 forks source link

Error building VuePress with yarn #3

Open sarimabbas opened 4 years ago

sarimabbas commented 4 years ago

Thank you for your work on this package. Unfortunately, I'm getting the following error when building VuePress website. Strangely, everything works in dev mode. Would you be able to assist? Thank you!

ReferenceError: window is not defined
    at Module.fb15 (node_modules/vue-lazyload-video/dist/vue-lazyload-video.common.js:2504:1)
    at __webpack_require__ (node_modules/vue-lazyload-video/dist/vue-lazyload-video.common.js:474:0)
    at server-bundle.js:781:18
    at Object.5020 (node_modules/vue-lazyload-video/dist/vue-lazyload-video.common.js:541:0)
    at __webpack_require__ (node_modules/vue-lazyload-video/dist/vue-lazyload-video.common.js:21:0)
    at Module.fb15 (node_modules/vue-lazyload-video/dist/vue-lazyload-video.common.js:4144:0)
    at __webpack_require__ (node_modules/vue-lazyload-video/dist/vue-lazyload-video.common.js:21:0)
    at server-bundle.js:328:18
    at Object.<anonymous> (node_modules/vue-lazyload-video/dist/vue-lazyload-video.common.js:88:0)
    at __webpack_require__ (webpack/bootstrap:25:0)
    at Module.<anonymous> (server-bundle.js:8196:33)
    at __webpack_require__ (webpack/bootstrap:25:0)
    at Object.<anonymous> (server-bundle.js:4759:18)
    at __webpack_require__ (webpack/bootstrap:25:0)
    at server-bundle.js:118:18
    at Object.<anonymous> (server-bundle.js:121:10)
error Command failed with exit code 1.
adrienhobbs commented 4 years ago

Hi there @sarimabbas - unfortunately this package and its dependencies weren't created with server side rendering in mind - which I'm assuming is why you're getting some errors when trying to build the static site. Perhaps in the future I can look towards making this SSR compatible.

sarimabbas commented 4 years ago

I understand, thanks for your response : )

adrienhobbs commented 4 years ago

Of course. Have you done any Vue plugin development before? I haven’t done much research on SSR and how to handle it in Vue plugins. I’d definitely invite your help if so inclined! Do you know of any other plugins I could use as an example?

On Thu, Dec 26, 2019 at 20:56 Sarim Abbas notifications@github.com wrote:

I understand, thanks for your response : )

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/adrienhobbs/vue-lazyload-video/issues/3?email_source=notifications&email_token=AA23WQVCJYRHORLKMGUCLNDQ2VOGHA5CNFSM4J7E4TSKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEHWMLWA#issuecomment-569165272, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA23WQX4XQ2OPH7ZDUR7NSDQ2VOGHANCNFSM4J7E4TSA .

sarimabbas commented 4 years ago

I haven’t done any before, but I’m happy to learn! I can do some more research into this and let you know what I find

adrienhobbs commented 4 years ago

Sounds great. Let me know if any questions come up!