ReferenceError: window is not defined when building
sublayerio opened this issue · comments
Hi Brent,
Great piece of work. Upon building I get the error ReferenceError: window is not defined
when using the window object. It's not obvious what might cause this, I guess it's related to the server side render when building.
Hi! Do the components or modules you're using try to access with window
object outside of the React component lifecycle?
I moved the usage of the window to the componentDidMount
function and it fixed the issue, thanks!