Server side rendering problem
See original GitHub issueAfter changing code from
const filestack = require('filestack-js').default
from
import filestack from 'filestack-js';
Following issue happens when I try to render a component with react-filestack on the server
ReferenceError: File is not defined
Because there is no File object in the server, this component cannot import filestack-js on the server. That is why I didn’t import ‘filestack-js’, but require(‘filestack-js’).default inside the click handler which only renders in client,
Issue Analytics
- State:
- Created 6 years ago
- Comments:7 (7 by maintainers)
Top Results From Across the Web
Challenges in server side rendering React apps (SSR)
Data Hydration is a typical problem we encounter with server side rendering. The server has pre-fetched data. However, when we call ReactDOM.
Read more >What is server-side rendering and how does it improve site ...
Server-side rendering (SSR) addresses the performance and search engine optimization issues of single-page JavaScript applications.
Read more >Why Server-Side Rendering Alone Is Not the Solution
The problem is, because the server assembles the UI, the UI, the server, and the data(base) need to be near each other. Otherwise,...
Read more >The Challenges and Pitfalls of Server Side Rendering
Server - Side Rendering (SSR) has become a go-to method for improving the load time of dynamic websites. Rendering content on the server...
Read more >The Perils of Rehydration - Josh W Comeau
Link to this heading. Server-side rendering 101 ... To understand the problem, we need to first dig a little into how frameworks like...
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 FreeTop 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
Top GitHub Comments
It should be inside the click event handler, so that it is only rendered in client. Look here
@velveteer yes at the moment I reverted to the original
require
from @ZeroCho within the function. I guess I’ll close the issue for now.