I ran across this issue and found that it was caused by Vite doing some extra code injection (github.com/vitejs/vite/issues/9829). It happened when I was trying to bundle emotion as a module. I ended up removing emotion from the module and using it as a dependency at the root of my project.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
I'm trying to use component selectors in my emotion styles. Did you have any luck doing so?
For example, I have this
OnOffSwitch
component which has some child elements:These styles (anything below
display: inline-block;
) are being ignored now.I've found this, but there's no mention of how to achieve this with Vite: github.com/emotion-js/emotion/issu...
Also this, which throws an error immediately ("Uncaught SyntaxError: missing ) after argument list"):
stackoverflow.com/questions/614352...
Here's my full
vite.config.js
(I use Vite in a Rails app):@vfonic I just spent the last few hours trying to debug this exact scenario! Did you ever find a solution?
I ran across this issue and found that it was caused by Vite doing some extra code injection (github.com/vitejs/vite/issues/9829). It happened when I was trying to bundle emotion as a module. I ended up removing emotion from the module and using it as a dependency at the root of my project.