React Server Rendering Errors
See original GitHub issueI’m trying to import this library into a React component which gets server rendered first then registers client side after. So essentially i need the same React component to work in the browser and in Node. This is causing issues in Node because i get Error: Sorry, the Vimeo Player API is not available in this browser..
Expected Behavior
The Javascript API should allow Node as a browser for some behavior. Even if the API does not support many functions in Node, the API should still allow you to at least import it without errors.
Actual Behavior
When trying to import this library server side in Node I get Error: Sorry, the Vimeo Player API is not available in this browser.
Steps to Reproduce
Import in any file server side.
Issue Analytics
- State:
- Created 7 years ago
- Comments:12 (3 by maintainers)
Top Results From Across the Web
React Server Side Rendering Errors
Hi,. I am using MDB React Pro v4.8.7. My team uses SSR for all of our websites but I have been getting errors...
Read more >Handling the React server hydration mismatch error
How to resolve the server mismatch error when hydrating a shared React component that can be used in client-side only or server-side rendered...
Read more >Error Boundaries - React
Error boundaries catch errors during rendering, in lifecycle methods, and in constructors of the whole tree below them.
Read more >React Server-side rendering error due to mismatch between ...
I am working on a React app (18.2.0 version to be exact), which uses server side rendering. On one of the pages, I...
Read more >Catching Server-side Rendering Errors in React JSS Apps
Error handling in React will be handled differently on a client and a server-side. Let's start with the first one.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

It looks like
import Vimeo from '@vimeo/player'triggers a function calling thewindowelement.The only way I could make this work was to use
requireinstead ofimport, and callrequireafter the component has been mounted.As in:
Is this still desired? I’d be happy to factor out a function to check the page for vimeo elements which would only run if
typeof window !== 'undefined'or some other equiv check.