sindresorhus/screenfull

Whenever I refresh the page I get "document is not defined"

iWanheda opened this issue · 3 comments

image

My code is literally:

useEffect(() => {
    if (vidState.fullscreen) {
      if (screenfull.isEnabled) {
        screenfull.request();
      }
    }
  }, [vidState.fullscreen]);```

Even if I just import it I get the error, without even using it!

@iWanheda I solved this by downgrading to version 5.1.0

See #194

The problem also exists when doing SSR in SvelteKit. While screenfull can't offer functionality on the server, it could be inert, and not throw on import.