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

Cannot process CSS modules in CRA #254

Open
nvh95 opened this issue Aug 27, 2022 · 0 comments
Open

Cannot process CSS modules in CRA #254

nvh95 opened this issue Aug 27, 2022 · 0 comments
Labels
bug Something isn't working

Comments

@nvh95
Copy link
Owner

nvh95 commented Aug 27, 2022

Describe the bug

jest-preview couldn't process CSS Modules if users are using Create React App

Screenshots

image

Reproduce

Just init a CRA app and use CSS Modules

Root cause and solutions

Since jest-preview use postcss-modules to process CSS Modules, on the other hand, (I guess) CRA uses postcss-preset-env to process CSS Modules. There are a few solutions:

  • Leave it as-is. Document about this and ask users to install postcss-modules. Print some useful error message as well
  • Add postcss-modules as a dependency
  • Add postcss-modules as a peerDependency. (Remember to allow any version)
@nvh95 nvh95 added the bug Something isn't working label Aug 27, 2022
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

1 participant