Closed radekwarisch closed 3 years ago
@radekwarisch thanks for opening the issue!
Looking at your repro, the issue seems to be that you're using the packages
directory instead of a default libs
directory for your libraries / packages code. If you'd like to keep using packages
, then in your nx.json
file you need to add the following property:
"workspaceLayout": {
"libsDir": "packages"
}
So we're on the same page - it's worth pointing out that you don't have to use yarn workspaces if you want to use Nx. While the two tools are not mutually exclusive, there's certainly some overlap in functionality.
Having said that, if you feel like there's some functionality that's missing from Nx that you have to rely on yarn workspaces for, definitely let us know, we'd love to hear that type of feedback!
This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context.
Current Behavior
When running the NextJS app (
yarn nx serve test
in the repo) with React components with SCSS module, imported from Yarn Workspaces package, there is an error displayed:Expected Behavior
I would expect components with SCSS modules to be consumed by NextJS app, as it is providing support for them out-of-the-box. The temporary fix we made was to use
@zeit/next-sass
and@zeit/next-css
plugins inside the next.config.js file. Then applications started to work, although I believe we shouldn't be forced to using them as they are deprecated.Steps to Reproduce
yarn nx serve test
command (the error should be displayed).yarn nx serve test-working
command (this should serve the exact app without any errors).Failure Logs
Error:
Environment
NX report: