Error while running `getDataFromTree` ReferenceError: document is not defined
See original GitHub issueError while running `getDataFromTree` ReferenceError: document is not defined
at /frontend/client/node_modules/tss-react/next.js:108:45
at /frontend/client/node_modules/tss-react/next.js:111:23
at AppWithEmotionCache (/frontend/client/node_modules/tss-react/next.js:116:110)
at processChild (/frontend/node_modules/react-dom/cjs/react-dom-server.node.development.js:3353:14)
at resolve (/frontend/node_modules/react-dom/cjs/react-dom-server.node.development.js:3270:5)
at ReactDOMServerRenderer.render (/frontend/node_modules/react-dom/cjs/react-dom-server.node.development.js:3753:22)
at ReactDOMServerRenderer.read (/frontend/node_modules/react-dom/cjs/react-dom-server.node.development.js:3690:29)
at renderToStaticMarkup (/frontend/node_modules/react-dom/cjs/react-dom-server.node.development.js:4314:27)
at /frontend/client/node_modules/@apollo/client/react/ssr/ssr.cjs.js:105:21
at new Promise (<anonymous>)
Versions
{
"tss-react": "^4.3.4",
"next": "12.3.1",
"@emotion/cache": "^11.10.3",
"@emotion/react": "^11.10.4",
"@emotion/server": "^11.10.0",
"@emotion/styled": "^11.10.4",
"@mui/icons-material": "^5.10.9",
"@mui/lab": "^5.0.0-alpha.103",
"@mui/material": "^5.10.9",
"@mui/styles": "^5.10.9",
"@mui/system": "^5.10.9",
}
Issue Analytics
- State:
- Created a year ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
Fixing Next js "ReferenceError: document is not defined"
The error is thrown because document is only available inside the browser and not on the server. Next js executes this code on...
Read more >Network error: document is not defined when accessing page ...
When I try to load a page that requires authentication without being authenticated I get the following document is not defined error in...
Read more >How To Fix ReferenceError document is not defined ... - Isotropic
If you are trying to use the document object and receiving a ReferenceError: document is not defined error then there is a good...
Read more >How to solve the document is not defined error - Flavio Copes
Here's how to fix the “referenceerror: document is not defined” error ... In Next.js you can fix this problem by wrapping the code...
Read more >ReferenceError: document is not defined (in plain JavaScript)
When you are using server side rendering there is no browser. Hence, there will not be any variable window or document . Hence...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Sorry, it’s a runtime error, my bad.
I’ll fix this tonight, I’ll let you know when it’s done.
Hi @garronej. Thank you for the quick fix! It perfectly work.
Also we had to downgrade from react 18 to 17. Because Apollo SSR doesn’t ready yet.
Would you tell me with what MUI component in particular?
- there is no a specific component. There are a lot broken things.Thanks again.