vue-intersection-observer icon indicating copy to clipboard operation
vue-intersection-observer copied to clipboard

HTMLElement is not defined when using Nuxt SSR

Open bradley-varol opened this issue 3 years ago • 1 comments

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.

bradley-varol avatar Jul 25 '22 22:07 bradley-varol

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

ulcuber avatar Aug 08 '22 08:08 ulcuber