-
Notifications
You must be signed in to change notification settings - Fork 27.6k
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: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: object #63394
Comments
The repository is empty. Please push your code into it @jrjake |
Yep, my mistake! I've pushed the code up now. |
If anyone is facing this error, a fix I found for it is: Change how you import material ui package from this: To this: |
its fixed in 14.3.0-canary.9. #64518 (comment) |
Apologies for delay in response, I can confirm this is fixed with that canary build. Does anyone know if this specific fix will be backported to 14.2.x? I tried testing with a more recent 14.3.0 canary but it appeared to be using React 19 beta, and I'm guessing that will delay 14.3.0 release for a decent while. I also believe Material UI has not added/claimed support for React 19, which will likely delay my ability to use them together for even longer. |
Looks like the latest canary reintroduced the error, cc @huozhi |
This should be fixed with latest 14.2.x, please upgrade to 14.2.3 |
This comment has been minimized.
This comment has been minimized.
This closed issue has been automatically locked because it had no new activity for 2 weeks. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you. |
Link to the code that reproduces this issue
https://github.com/jrjake/nextjs-mui-bug
To Reproduce
npm run dev
.Current vs. Expected behavior
This was working with Nextjs 14.1.3 and MUI 1.15.5, but I recently tried upgrading to MUI 1.15.13 and got this strange error.
When I console.log(the component), I get {} when "type": "module", but I get [Function (anonymous)] as expected when running without "type": "module".
Provide environment information
Operating System: Platform: linux Arch: x64 Version: #1 SMP PREEMPT_DYNAMIC Wed Mar 6 19:35:04 UTC 2024 Binaries: Node: 20.10.0 npm: 10.2.3 Yarn: N/A pnpm: N/A Relevant Packages: next: 14.1.3 eslint-config-next: N/A react: 18.2.0 react-dom: 18.2.0 typescript: N/A Next.js Config: output: N/A
Which area(s) are affected? (Select all that apply)
App Router
Which stage(s) are affected? (Select all that apply)
next dev (local)
Additional context
No response
The text was updated successfully, but these errors were encountered: