import css using twin.macro with styled-components fails. Below is the error when running local in my machine the cra-styled-component example. It works on codesandbox, but not local.
./src/components/Button.js
Attempted import error: 'css' is not exported from 'styled-components/macro' (imported as '_css').
I'm seeing this too when I use yarn to install.
npm works fine - I'll have to look into this issue further.
You can fix it for now by using this twin config:
"babelMacros": {
"twin": {
"preset": "styled-components",
"css": {
"from": "styled-components",
"import": "css"
}
}
},
Has babel updated something lately?
@ben-rogerson thanks a million for the fast response.
npm works fine
To me It's failing on both yarn or npm
@ben-rogerson thanks a million for the fast response.
npm works fine
To me It's failing on both yarn or npm
I'm seeing the same. The strangest thing about it is that it works fine in one component, but fails when I try and import into another. Both components are in the same directory.
Most helpful comment
I'm seeing this too when I use
yarnto install.npm works fine- I'll have to look into this issue further.You can fix it for now by using this twin config:
Has babel updated something lately?