question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot convert a Symbol value to a string with @emotion/babel-plugin and next.js

See original GitHub issue

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

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:15 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
bordeocommented, Feb 11, 2022

@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:

const Parent = styled("div")`
  /* color: red; */ /* <----- The problem is this. uncomment and it works */
  ${Child} {
    color: yellow;
  }
`;

Example https://codesandbox.io/s/next-material-emotion-broken-again-3u4d4

1reaction
mnajdovacommented, Feb 28, 2022

@bordeo I’ve just merged it. It will be available in today’s release.

Read more comments on GitHub >

github_iconTop Results From Across the Web

React component w/ singe child => Cannot convert a Symbol ...
When doing so I obtain the following error: Cannot convert a Symbol value to a string TypeError: Cannot convert a Symbol value to...
Read more >
emotion/babel-plugin
Babel plugin for the minification and optimization of emotion styles. @emotion/babel-plugin is highly recommended, but not required in version 8 and above ...
Read more >
Cannot convert a Symbol value to a string #11554 - Issuehunt
Have story wrapped in a React.Profiler; Have docs addon enabled; Open story in story book. Expected behavior It should not throw this error....
Read more >
babel/plugin-transform-react-jsx
string , defaults to React.createElement . Replace the function used when compiling JSX expressions. Note that the @jsx React.DOM pragma has been deprecated...
Read more >
NOTICE.pdf - NetApp Cloud Central
@emotion/babel-plugin-jsx-p ... postcss-convert-values 4.0.1 MIT License ... js-utils-tests 1.4.1, killable 1.0.0, medikoo/next-tick 1.1.0, node 9.11.2, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found