Server side rendering with nextjs styles issue with JSS
See original GitHub issue- The issue is present in the latest release.
- I have searched the issues of this repository and believe that this is not a duplicate.
Current Behavior 😯
After opening my NextJS app with yarn dev I get the following error Even after following exactly the example here https://github.com/mui-org/material-ui/tree/next/examples/nextjs-with-typescript. I still get the error
Expected Behavior 🤔
I should not get the error after doing the server side rendered css removal and so on explained here https://github.com/mui-org/material-ui/tree/next/examples/nextjs-with-typescript
Steps to Reproduce 🕹
Couldn’t get the codesandbox.io to work with my app so I am giving a github repo instead. Hope it’s not a problem. Steps:
- Go to https://github.com/dimitur2204/ticketbrite
- Clone the repository with git clone
- cd into the client folder
- run
yarn dev
- Navigate to http://localhost:3000/signup
- Open the console and you will see the error
Context 🔦
I was trying to do a SSR app with NextJS when I stumbled upon the issue. Then I saw that I need to do that thing with the ServerStyleSheets. But still wasn’t able to resolve the problem after following the example.
Your Environment 🌎
System: OS: Windows 10 10.0.19041 Binaries: Node: 16.3.0 - C:\Program Files\nodejs\node.EXE Yarn: 1.22.10 - ~\AppData\Roaming\npm\yarn.CMD npm: 7.15.1 - C:\Program Files\nodejs\npm.CMD Browsers: Chrome: 91.0.4472.101 Edge: Spartan (44.19041.1023.0), Chromium (91.0.864.54) npmPackages: next: 11.0.0 @material-ui/core: ^4.11.4 => 4.11.4 @material-ui/styles: 4.11.4 @material-ui/system: 4.11.3 @material-ui/types: 5.1.0 @material-ui/utils: 4.11.2 @types/react: 17.0.11 => 17.0.11 react: 17.0.2 => 17.0.2 react-dom: 17.0.2 => 17.0.2 typescript: 4.3.4 => 4.3.4
Browser: Google Chrome Version 91.0.4472.106 (Official Build) (64-bit)
`npx @material-ui/envinfo`
Don't forget to mention which browser you used.
Output from `npx @material-ui/envinfo` goes here.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:17
- Comments:28 (8 by maintainers)
Top GitHub Comments
i also got same problem. after update Next Js version 11 , Box component show this error message
Try removing
reactStrictMode: true
fromnext.config.js
or setstrict: false
intsconfig
etc In my case, this solved the problem