material-ui: Cannot convert a Symbol value to a string with @emotion/babel-plugin and next.js
Error: Cannot convert a Symbol value to a string when using @emotion/babel-plugin with next.js
- The issue is present in the latest release.
- I have searched the issues of this repository and believe that this is not a duplicate.
Current Behavior šÆ
Using components as selectors thrown an error when compiling server-side. In client-side application it works as expected
Expected Behavior š¤
No errors are thrown and the ācomponent as selectorā works
Steps to Reproduce š¹
Server-side application doesnāt works https://codesandbox.io/s/next-material-emotion-ojfum Client-side application works https://codesandbox.io/s/cra-craco-mui-styled-8ji8i
Context š¦
I would like to use component as selector
Your Environment š
`npx @mui/envinfo`
System:
OS: Linux 5.4 Debian GNU/Linux 10 (buster) 10 (buster)
Binaries:
Node: 14.17.6 - ~/.nvm/versions/node/v14.17.6/bin/node
Yarn: 1.22.11 - ~/.nvm/versions/node/v14.17.6/bin/yarn
npm: 6.14.15 - ~/.nvm/versions/node/v14.17.6/bin/npm
Browsers:
Chrome: 94.0.4606.81 (Official Build) (x86_64)
Firefox: Not Found
npmPackages:
@emotion/react: 11.4.1 => 11.4.1
@emotion/styled: 11.3.0 => 11.3.0
@mui/core: 5.0.0-alpha.50
@mui/material: 5.0.3 => 5.0.3
@mui/private-theming: 5.0.1
@mui/styled-engine: 5.0.1
@mui/system: 5.0.3
@mui/types: 7.0.0
@mui/utils: 5.0.1
@types/react: 17.0.29
react: 17.0.2 => 17.0.2
react-dom: 17.0.2 => 17.0.2
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 1
- Comments: 15 (6 by maintainers)
@mnajdova @Andarist I would like to re-open this issue because it doesnāt work when the parentās css rule has no other rules. eg:
Example https://codesandbox.io/s/next-material-emotion-broken-again-3u4d4
@bordeo Iāve just merged it. It will be available in todayās release.
@bordeo Iāve prepared a fix here: https://github.com/mui/material-ui/pull/31024
Iāll take a look at this - I have a hunch for what is going on but need to do some digging.