Closed glekner closed 1 year ago
Is this an allowed thing? I get the same crash of used before initialise with the babel plugin (which is provided by styled components team themself.)
this could very well be something that is not allowed, I wonder why with babel it did not throw this warning I think this can be closed? cc @bengry
this could very well be something that is not allowed, I wonder why with babel it did not throw this warning I think this can be closed? cc @bengry
Yea, this seems to crash when using babel as well, so I think the case is closed and the issue can be closed.
Thanks @ArnaudBarre
css
properties on HTML elements are definitely allowed by the styled components babel plugin.
The reproduction provided failed with the Babel plugin. I think the issue is using it on nodes outside of a component.
What do you mean by "outside a component"?
In my case it's failing (actually, not doing anything, no errors though) with a simple:
const App = () => {
return (
<div
css={css`
width: 100vw;
height: 100%;
display: flex;
`}
>foo</div>
);
}
Please open a new issue. But the probability of being an issue with this plugin is low. The SWC plugin provided by the SWC team maybe not be 100% compatible with the Babel, although for now people seems to have no issues with it
It looks like it was just a version problem, I was on 3.0.0, upgrading fixed it
repro - https://github.com/glekner/vitejs-vite-tusww5
produces the warning
The element seems to be undefined when
React.createElement
is being called: