vue-intersection-observer
vue-intersection-observer copied to clipboard
HTMLElement is not defined when using Nuxt SSR
The latest version is breaking my Nuxt 2 SSR website as HTMLElement (defined as a prop type) is not defined on the server. window is probably the same.
As a quick workaround, I ended up just creating my own component with the code from this library's component, minus the breaking HTMLElement propType.
Tried workaround (not working):
<client-only>
<observer>
</observer>
</client-only>
See: https://nuxtjs.org/docs/features/nuxt-components/#the-client-only-component
Related: https://github.com/BiYuqi/vue-intersection-observer/commit/c4f1beb2596d94586076d294f3b45ccf69fc53b5