-
-
Notifications
You must be signed in to change notification settings - Fork 32.3k
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 able to build the project when updating to Next.js 14.2.2 with v5.15.15 #41960
Comments
Duplicate of #41865. Use |
Hi @Juneezee, Thanks for the quick reply.
|
@Heet-Bhalodiya In that case, I think you'll have to downgrade to Next.js 14.1.4 for now. See vercel/next.js#64467 (comment) too. |
This was huge, thank you—fixed the most frustrating build bug with The example project doesn't seem to run either (broken by 14.2.X) https://github.com/mui/material-ui/tree/next/examples/material-ui-nextjs-ts |
Hey Team, The fix is published in the NextJS Closing this issue. |
Steps to reproduce
Link to live example: https://codesandbox.io/p/devbox/fragrant-architecture-xjjj78?file=%2Fapp%2Fpage.tsx%3A6%2C12
Steps:
npx create-next-app@latest
npm install @mui/material @emotion/react @emotion/styled
commandCurrent behavior
The basic NextJS project runs fine after initial setup. However, after integrating MUI and using its components, the project still operates normally in development mode. But, when I build the project, I receive the following error:
Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: object
Using
use client
with MUI components allows the project to build and run without errors.I am using NextJS
v14.2.2
version andv5.15.15
of MUI.Expected behavior
After updating MUI and NextJS the above issue is happening.
The components should function correctly after a build, without needing to use
use client
, similar to how they did in previous versions.Context
No response
Your environment
npx @mui/envinfo
Search keywords: NextJS, MUI, Element type is invalid, build, use client
The text was updated successfully, but these errors were encountered: