-
-
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
[Migration] Cannot upgrade to v5 with styled-components #29675
Comments
Even a fresh project created with I'm using latest node version (v16.13.0) on Windows. Additionally, installing @emotion/react with npm does not have any effect ☹ |
The NextJS example appears to have the same issue. With a fresh project I can get a MUI component to work in dev mode by adding it to a running page, but as soon as I reload the page the error occurs. Odd! cc @mnajdova |
@AdiGutner what version of nextjs are you using? The last time I tested it was on version 11, but 12 was released recently. I will check this now. |
The issue is temporarily happening because the index 114ee969d9..39aaede564 100644
--- a/examples/nextjs-with-styled-components-typescript/next.config.js
+++ b/examples/nextjs-with-styled-components-typescript/next.config.js
@@ -1,4 +1,4 @@
-const withTM = require('next-transpile-modules')(['@mui/material', '@mui/system']); // pass the modules you would like to see transpiled
+const withTM = require('next-transpile-modules')(['@mui/material', '@mui/system', '@mui/core']); // pass the modules you would like to see transpiled
module.exports = withTM({
reactStrictMode: true, |
I think you guys should make a nextjs-styled-components example without typescript too. I am having a really hard time migrating my v4 project to v5. I think that the latest v4 release should stay stable for a long time and maintained. Meanwhile i am not switching until stability is proven with nextjs. |
This is already available - https://github.com/mui-org/material-ui/tree/master/examples/nextjs-with-styled-components-typescript
Just to make sure, are you using
Our documentation is using the v5 with nextjs, I believe this is proving it's stability. Note that the issue is related to using v5 with |
Without...
just makeStyles.. |
Just followed the guide again, migrating my Nextjs 12 mui v4 (just JSS) to v5 , got this error :
coming from the
None of the index.js or _app.js files uses any kind of styles related to mui. Just the StyledEngineProvider and ThemeProvider wrapping the root. |
Feedback: Fyi I tested this and it's not working with the latest @mui packages |
I believe this is a related problem: https://github.com/aviculturist/cnry/runs/4246215092?check_suite_focus=true#step:6:197
In this case, an upgrade to the latest @mui broke my build process with the above error. Using
|
I am having the same issue. Oddly though, I only get this error when deploying to Vercel, everything works fine locally. |
When I reverted back to |
Note that there are currently some issues with |
Hi, i'm not sure if this is relatable or not but i'm having the same issues while running my project locally (react/typescript) Failed to compile. /node_modules/@mui/system/esm/createStyled.js currently using the latest version of mui/styled-engine |
This is likely due to a mismatch between the versions, check #33878 |
I have a project with NextJS, React, Typescript, MUI and Styled-Components
I tried to upgrade MUI version from v4 to v5 and followed all the required steps, but I get build errors
next.config.js
is defined as follows:Please advise
The text was updated successfully, but these errors were encountered: