Skip to content
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

Error when running tests using styled-components babel plugin #11

Open
gbhavalkar opened this issue Oct 23, 2018 · 3 comments
Open

Error when running tests using styled-components babel plugin #11

gbhavalkar opened this issue Oct 23, 2018 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@gbhavalkar
Copy link
Collaborator

base.configFile error when running tests using babel-plugin-styled-components
Invalid presets in configuration object
Link for reference : facebook/create-react-app#5259

@gbhavalkar gbhavalkar added the bug Something isn't working label Oct 23, 2018
@gbhavalkar
Copy link
Collaborator Author

It seems to be work when i dont add the babel plugin
But then u have to add the displayName property for every styled component for enzyme

@alivenotions
Copy link
Owner

The babel plugin isn't really working because we are not adding it to the babel config (hidden inside react-scripts).
It is working when I eject from CRA and then add this to the babel plugins:

"plugins": [
  [
    "styled-components", {
      "displayName": true, "fileName": false
    }
  ]
]

The question is, whether we should eject from CRA?

@alivenotions
Copy link
Owner

The alternatives like react-app-rewired that allow us to modify webpack/babel without ejecting do not support CRA 2.0. Just FYI!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants