-
-
Notifications
You must be signed in to change notification settings - Fork 140
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
(...).createGlobalStyle.withConfig is not a function #315
(...).createGlobalStyle.withConfig is not a function #315
Comments
The targeting of the Babel plug-in isn't quite that precise, so it never associates the So when you import the entire namespace as
To prevent this you can import the This does look like a bug since this detector here is faulty:
|
Yup, thx @kitten! |
Same error for me, simple reproduce:
But if I do |
Can y'all try out |
Similar to this comment workaround, when i use createGlobalStyle like this:
import * as styled from 'styled-components';
export const GlobalStyle = styled.createGlobalStyle``;
, i get the error(...).createGlobalStyle.withConfig is not a function
on a Next.js / Typescript projectThe bug is resolved when I use the solution presented in the comment above, using CommonJS require:
const createGlobalStyle = require('styled-components').createGlobalStyle
export const GlobalStyle = createGlobalStyle``;
Is it a bug or a setup issue?
The text was updated successfully, but these errors were encountered: