react-responsive-image
react-responsive-image copied to clipboard
Error on server side rendering
I'm using razzle to server side render my react app and it shows this error:
ReferenceError: window is not defined at Object../node_modules/react-responsive-image/assets/js/lib/react-responsive-image.build.js
@bezugen In many cases it can be fixed using a polyfill in node.
import '@babel/polyfill';
HI, @bezugen did @micros123 fix help you? I have been having this issue on Netlify and have fixed the issue in my fork by adding checks for the window object in the ResponsiveImage.jsx file in assets/js/src/components/ResponsiveImage.jsx and rebuilding the minified js.