question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Server side rendering problem

See original GitHub issue

After 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:closed
  • Created 6 years ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
ZeroChocommented, Apr 7, 2017

It should be inside the click event handler, so that it is only rendered in client. Look here

0reactions
samuxyzcommented, May 1, 2017

@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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found