I have tried to implement SSR in react js using express js. While we render the client page from server file it throwing browser level object not supported/undefined error in node modules.
If the window/document/localstorage is undefined in application file then can able to solve the issue making some conditions as recommended in this link React - “localStorage is not defined” error showing but the error occurred in node modules.
Here I have attached link for the reference for browser level object only working on client side rendering. https://stackoverflow.com/questions/32126003/node-js-document-is-not-defined#:~:text=The%20short%20answer%20is%20don,are%20not%20available%20in%20node.
My application is, React: ^16.12.0 (Created by using create-react-app, build done by using react-scripts command) Node: v14.17.1 Express: ^4.17.3
Screenshot for reference: document undefined