Closed huntersinclairtiv closed 8 years ago
+1
I started a new server-side rendering project and got the same issue.
/node_modules/enquire.js/dist/enquire.js:8 var matchMedia = window.matchMedia; ReferenceError: window is not defined
I don't know much about enquire.js, but it sounds kinda of obvious that it can't find a window on the server
Hi guys,
I've tried to fix this by conditionally loading the dependency if window
is available. Let me know if it helps!
Sadly, my issue still exists. Thanks for jumping on it this quick though!
This is very annoying but I've tried again by changing the output from 'umd' to 'commonjs2', which I hope is fine for most people!
Definitely fixed. No more crash. Thanks!
Currently i have the same problem. With v8 and server side rendering i can't load the component. We currently have to set the window property for some other plugins. So this is no option for us :( Is there another way to handle this properly?
If I include this module in my react project I get window undefined error thrown related to enquire.js library.