-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Cypress component tests - SCSS files can't resolve assets #22378
Comments
I spend some more time figuring out if I could resolve it on my own, but sadly I couldn't resolve it. I also created a brand new repo with The AppComponent has every case covered, so I think it's a nice setup to debug it: Also when I change the assets to only this: Maybe that's a general issue with the path mapping |
I updated the dependencies from 18.1.3 to 18.2.4 and the errors are still happening. |
@FrozenPandaz Can you please give a rough estimation when you can look into this? This issue currently blocks us from starting with cypress component tests |
Hey @konstantinschuette! I'm sorry for the delay in responding. I'll have a look and post here any updates. |
@konstantinschuette, I can reproduce the issue on an Angular CLI repo with Cypress (no Nx). This seems to be a limitation on the Cypress side, and I created an issue on their repo to track it: cypress-io/cypress#29483. |
I'm dealing with the exact issue as well. I assume that Looking at the output in the terminal I can see that Cypress is trying to load the config |
I'm closing this in favor of the upstream issue cypress-io/cypress#29483. Unfortunately, there's nothing we can do on the Nx side to address this. Please follow the linked issue in the Cypress repo for a resolution. |
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
Serving and building the apps works perfectly fine, this issue is only happening for the cypress component tests.
When running the component tests, SCSS errors are thrown. It seems like the postcss-loader can't resolve the paths. But the icons and fonts are properly loaded in the app, when I run the tests.
The only exception is that I have defined the assets from the libs folder to resolve to
/assets
. This doesn't seem to work. I have to define it like this that the path is correctly resolved:<img src="assets/logo.svg">
Expected Behavior
The SCSS import paths should be correctly resolved without any errors when building.
GitHub Repo
https://github.com/konstantinschuette/nx-ng-cypress-component-test-scss-error
Steps to Reproduce
nx run products:component-test --watch
Nx Report
Failure Logs
No response
Package Manager Version
No response
Operating System
Additional Information
No response
The text was updated successfully, but these errors were encountered: