-
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
Next 14.0.4 breaks Mui integration that worked with 14.0.3 and older versions #59804
Comments
Thanks for the reproduction! Also cross-posting it here: #59254 (comment). We will be taking a look. |
Installing the dependencies
ConfigurationInside
|
Yes I know that, my reproduction setup includes the new way of integration. But with Next 14.0.4 it works neither way. The 'old' way where you have to write your own ThemeRegistry and the new way, that is included in the reproduction lead to the same error. |
@schimi-dev |
Having the same issue with "next": "14.0.4", "@mui/material": "^5.15.2", "@mui/material-nextjs": "^5.15.0" I could fix it with below work arounds, but the expectation is to work without these. Fix 1 : Use default exports
instead of
Fix 2: Use
|
But that's not a solution. Experiencing the same issues also. |
+1 same issue. None of the two fixes are viable solutions for my project. |
Also, does anyone know if |
So basically, the issue is reproducible when using Workarounds (note that these are NOT solutions)
|
FWIW I'm encountering this issue in both a large legacy app and a much smaller starter kit that I've been working on with 14.0.4, in a repo that doesn't use MUI. Everything works when using EDIT: put together a minimal PR: |
"@mui/material-nextjs": "^5.15.4", |
For @DonikaV and other who might be having issues with Simply pick the previous version instead. See linked ticket on MUI repo for discussion on when the fix should be made available. |
As Barrel Optimization might split one file into multiple different modules, i.e. when you import different values from it, the target file might be transformed differently, we can no longer rely on the file path as the identifier of the client reference. This fix adds a suffix (`'@' + this._module.matchResource`) to the identifier so it looks like `/filepath/file.js@__barrel_optimize__?names=Foo`. Here's also a quick diagram to explain: ![CleanShot-2024-01-16-QzlxzMKy@2x](https://github.com/vercel/next.js/assets/3676859/99f25975-b965-4ae0-91f2-269a6a0d7458) Closes #59804. Closes NEXT-2108. --------- Co-authored-by: Jiachi Liu <[email protected]>
The fix is landed in latest canary 🙏 |
to be specific: |
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/schimi-dev/next-mui-bug-reproduction
To Reproduce
npm run dev
Current vs. Expected behavior
Current behavior
The console log:
The UI in the browser:
![next-mui-error](https://private-user-images.githubusercontent.com/93941373/291877931-98ff2905-e9be-4309-81dc-6800cdf19242.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkxNjkzNzAsIm5iZiI6MTczOTE2OTA3MCwicGF0aCI6Ii85Mzk0MTM3My8yOTE4Nzc5MzEtOThmZjI5MDUtZTliZS00MzA5LTgxZGMtNjgwMGNkZjE5MjQyLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTAlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjEwVDA2MzExMFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTQ2YzgwNGVhOWU2ZTEwZmY3OTA1MTE3ZjlkNTk2NGUyNGY1NzIwZDk5NmQ0MzVlYzVmZTg4ZTA1YjYwNzFiZGEmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.aEJ2Vnu0ZqD6cqVi5LRgbPAeFJ8Tqbh-hzJ1BE3uI14)
Expected behavior
No error is logged to the console.
The UI in the browser is displayed without an error.
(That's how the app behaved with
14.0.3
)Verify canary release
Provide environment information
Which area(s) are affected? (Select all that apply)
Not sure
Additional context
The integration between Mui and the App Router was done according to:
https://mui.com/material-ui/guides/nextjs/
These issues might be related:
#59386
#59535
This discussion is related:
#59534
NEXT-1967
The text was updated successfully, but these errors were encountered: