Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

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

Closed
iWanheda opened this issue Jan 1, 2022 · 3 comments · Fixed by #208
Closed

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

iWanheda opened this issue Jan 1, 2022 · 3 comments · Fixed by #208

Comments

@iWanheda
Copy link

iWanheda commented Jan 1, 2022

image

My code is literally:

useEffect(() => {
    if (vidState.fullscreen) {
      if (screenfull.isEnabled) {
        screenfull.request();
      }
    }
  }, [vidState.fullscreen]);```
@iWanheda
Copy link
Author

iWanheda commented Jan 1, 2022

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

@RyanWarner
Copy link

@iWanheda I solved this by downgrading to version 5.1.0

See #194

@MajorBreakfast
Copy link
Contributor

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.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants