Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

navigator is not defined #131

Open
romanown opened this issue Jun 22, 2018 · 7 comments
Open

navigator is not defined #131

romanown opened this issue Jun 22, 2018 · 7 comments

Comments

@romanown
Copy link

when I go to the page with the video from the main page of the site it works well. but when I go to the page with the video on a direct link then such an error.
ReferenceError: navigator is not defined
at /var/www/dfor.ru/node_modules/react-html5video/dist/index.js:2496:61
at Video.render (/var/www/dfor.ru/node_modules/react-html5video/dist/index.js:259:35)

@gazreese
Copy link

I get the same thing

@mderrick
Copy link
Owner

mderrick commented Jul 19, 2018

Sounds like you're both server side rendering. A video can't be server side rendered. You should check and render a placeholder when rendering on the server.

@romanown
Copy link
Author

romanown commented Jul 19, 2018 via email

@Brightchild
Copy link

Is there a solution to this problem? Hope reply

@jonanderdev
Copy link

jonanderdev commented Jan 23, 2019

@Brightchild @romanown @mderrick
We encountered the same problem.
Is a typical issue with server side rendering and some libs that make use of things like navigator or window. So I implemented a simple fix and submitted a PR #142 with it.
Hope it'd help you guys as much as it helped us.

@romanown
Copy link
Author

romanown commented Jan 23, 2019

thank you. I deleted this line and it works for me. of course Your decision is more correct.

@twotabsofacid
Copy link

Anyone else finding themselves here: since there PR was never merged a different workaround I found was to use the react-no-ssr package and wrap the <video> tags within a <NoSSR> tag. Ugly but it stopped stuff from breaking.

Hope this helps someone.

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

Successfully merging a pull request may close this issue.

6 participants