I am using server side rendering and while bundling the server file via webpack i am getting an error.
ReferenceError: window is not defined
I even tried faking a window object but it didn't work either.
I did this with no success
if (typeof window === "undefined") {
global.window = {};
}
I also made sure i am only using window object inside componentDidMount.
Can anyone please help me out? Why i am getting this and how can i resolve it?