Closed nogurenn closed 6 years ago
Hey there. I could make this opt out of server side rendering when window is not defined however it doesn't make much sense. In these Server Side Rendering packages there usually are two different entrypoints. You should look for something called client.js in contrast to server.js. In the client.js you import this package using es6 import right after fabric.js.
Though its a closed issue but it may going to help someone who is trying to resolve this error while SSR,
i'm trying get it work in react with SSR so basically problem is, window
is not available on server renderer, so better to not to import on component
import "fabric-customise-controls";
- THIS WILL NOT WORK
componentDidMount
as it do not get executed while SSR componentDidMount() { require('fabric-customise-controls'); // **THIS IS WORKING UNDER SSR** }
I've checked React Starter Kit for information regarding this and it appears I need fabric-customise-controls to render client-side only. However, how can I do this? Is there a way to support server-side rendering?
Relevant dependencies