silencesys / silentbox

A lightbox inspired Vue.js component.
https://silentbox.rocek.dev
MIT License
296 stars 51 forks source link

Incompatible with SSR #18

Closed DanielStout5 closed 4 years ago

DanielStout5 commented 5 years ago

This is a similar issue to this one: https://github.com/silencesys/silentbox/issues/14 but it has a different cause.

I'm using the latest version of vue-silentbox (0.1.9)

If I include the library, I get this error: document is not defined

It is from this line in vue-silentbox.esm.js

var HEAD = document.head || document.getElementsByTagName('head')[0];

Which is related to this issue in vue-component-compiler (which gets into vue-silentbox via rollup-plugin-vue) https://github.com/vuejs/vue-component-compiler/issues/85

Is it possible to avoid using rollup-plugin-vue?

silencesys commented 5 years ago

Thanks for filling the issue, I'll check if there is a way how to avoid using rollup-plugin-vue, but it will probably require a different compiler. I am busy right now, so I'm not sure when I'll be able to look at this problem.