Can't use styled-engine-sc with jest and npm
See original GitHub issueDuplicates
- I have searched the existing issues
Latest version
- I have tested the latest version
Current behavior 😯
Hello.
I just migrated to material ui v5. I’m using it with styled components.
Everything is OK when I start my app with craco and webpack with the alias config.
Now, i’m trying to launch my jest tests, but I have the engine problem (Module not found: Can’t resolve ‘@emotion/react’ )
npm run test
scripts:{ "test": "craco test }
As jest is not launched with webpack, the styled engine configuration is not applied.
What is the solution to use jest, mui with styled components, and npm ?
Thanks
Issue Analytics
- State:
- Created 2 years ago
- Comments:8 (3 by maintainers)
Top Results From Across the Web
create-react-app-with-styled-components fails with Can't ...
I have noticed two issues with CRA+npm: styled-engine-sc doesn't get installed when using the release tag, need to change it:.
Read more >Material-UI v5 not working styled-components and typescript?
The mui installation says you can use emotion OR styled-components ... "npm:@mui/styled-engine-sc@latest", "@types/styled-components": ...
Read more >@mui/styled-engine-sc - npm
styled () API wrapper package for styled-components.. Latest version: 5.11.0, last published: 13 days ago. Start using @mui/styled-engine-sc ...
Read more >FAQs - styled-components
In general, always use the css helper when composing styling partials to be interpolated into a styled component.. import styled, { keyframes } ......
Read more >@mui/styled-engine - Material UI
Using styled -components as an engine at this moment is not working when used in a SSR projects. The reason is that the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi @mnajdova
I succeed to launch my tests by adding a similar configuration for jest in my
craco.config.js
It is not optimal but it works.
Great, ok it’s good to have it as a reference for other people hitting the same problem.