-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
styled.css.withConfig is not a function Error using Rollup #2681
Comments
Hi got the exact same problem here: Any idea ? |
@fjn2 Can you provide more codes of the css (checkedStyles) component? Then we can reproduce this issue easier. |
I've the same issue as above, did you guys find a solution? |
I got the same issue I'm using 4.3.2 Did anyone find a solution? It can be related to styled-components/babel-plugin-styled-components#222 |
This might be a little late for most here, but for anyone who's new, this seems to be an ugly fix for this issue. Instead of importing
You may need to do the same with |
@coolgod I think you got to the right point. Did you manage to fix it at least locally? So far I've tried
commonJs({
include: /node_modules/,
namedExports: {
'react-is': ['typeOf', 'isElement', 'isValidElementType', 'isForwardRef'],
'styled-components': ['css']
}
}),
Nothing seems to work, anything else I can try? |
I've deleted my original comment because it is just totally wrong. It turned out, my issue was caused by duplicated transcompiling of a javascript file during running unit tests (The issue for me happens when I use Once I configured
Also during debugging this, it appears to me there is just no such thing as ref: https://jestjs.io/docs/en/configuration#transformignorepatterns-arraystring |
Most of the time Rollup build issues are caused by:
All of these lie outside of what makes sense as an issue here, so Rollup may have more helpful help channels. |
I'm using Rollup for build and distribute my React components .
When I use
css
from styled component, any import in that bundle failsie:
The whole import fails (see error below).
There is not errors in the rollup build.
If I remove the
css
(checkedStyles) component start working againrollup config
babel rc
Environment Information
System:
Binaries:
npmPackages:
Expected Behavior
Show the components imported from Rollup bundle.
Actual Behavior
This error point to this line
var checkedStyles = styled.css(["background:red;"]);
I've checked several tickets, but any of those help me to solve this.
Thanks in advance.
The text was updated successfully, but these errors were encountered: