-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[material-ui] Not working correctly with Next.js 'edge' runtime #39338
Comments
I debugged and found that the created theme has |
I'd like to add that the |
I am experiencing similar behaviour, which was caused by switching to edge runtime. I got this error: Which comes from |
+1 on this issue Getting the following error when adding edge to a SSR page using MUI.
|
Hi @brijeshb42, Any news on this issue? Thanks! |
@brijeshb42 @DusanStojanovic-gowago |
Same issue here also, now our only blocker for moving to edge runtime |
@DusanStojanovic-gowago @jordanvector Could you verify if edge runtime is working with v5.15.4 of |
@brijeshb42 I confirm the edge runtime is working with the latest version of |
@brijeshb42 yes I can confirm latest version of @mui/material is working with edge runtime. Great work! |
Steps to reproduce 🕹
Currently, the material-ui doesn't work correctly with the NextJS edge runtime. There are warnings in a terminal and an error in the HTML.
I created a sample repository here.
Steps:
npx create-next-app@latest
(I selected the app router and typescript),npm install @mui/material @emotion/react @emotion/styled
,ThemeRegistry.tsx
and use it in theapp/layout.tsx
. I followed the guide here,edge
runtime in theapp/layout.tsx
:export const runtime = "edge";
,<html id="__next_error__"
error on refresh, and warnings in the terminal:[TypeError: Cannot read properties of undefined (reading 'fontWeightBold')]
Npm packages:
Current behavior 😯
When I refresh the page, I see the error on the
<html>
tag like on the screenshot:<html id="__next_error__"
I can also see the following warnings in the terminal:
Expected behavior 🤔
__next_error__
Your environment 🌎
npx @mui/envinfo
The text was updated successfully, but these errors were encountered: