Next.js 13 compatibility (app directory/server components)
See original GitHub issueDuplicates
- I have searched the existing issues
Latest version
- I have tested the latest version
Summary 💡
MUI doesn’t work in Next.js 13 server components (app directory). Even though the error comes from @emotion\react and not Material UI itself, I think this should be tracked here as well.
The “primary” error (there might be other problems once the Emotion issue is fixed) is:
TypeError: React.createContext is not a function (sc_server)\node_modules@emotion\react\dist\emotion-element-b63ca7c6.cjs.dev.js (20:47)
Related Emotion issue: https://github.com/emotion-js/emotion/issues/2928
Examples 🌈
I’ve created a minimal (failing) example using create-next-app: https://github.com/MidnightDesign/nextjs13-material-ui
Motivation 🔦
No response
Issue Analytics
- State:
- Created a year ago
- Reactions:21
- Comments:5 (5 by maintainers)
Top Results From Across the Web
Blog - Next.js 13
The app/ directory introduces support for React's new Server Components architecture. Server and Client Components use the server and the client ...
Read more >What's New in Next.js 13 - AppSignal Blog
js 13 is that all components inside the app directory are React Server Components by default, including special files and colocated components ( ......
Read more >What's new in Next.js 13, and what do they really do?
How real-world code and architecture need to adapt to Server Components, ... /pages directory, but everything you put in /app uses Next.js 13's...
Read more >What and Why: React Server Components in Next.js 13
js 13 introduced app directory architecture which is an entirely new way to architect your Next.js applications with React Server Components in ...
Read more >LeafLet implementation on Next JS 13 - reactjs - Stack Overflow
you are using the new app/directory routing or the pre-existing pages routing to load leaflet components? – João Danilo Zucolotto. Nov 2 at...
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 Free
Top 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

Sure, I plan to work on this on Monday, will review once again all the issues.
@mnajdova Since your #34905 seems to be the umbrella issue now, feel free to edit this one to be just about the specific problem with Emotion.