-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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 CT + Angular can't resolve assets from stylesheets #29483
Comments
Even when using a standard Below are the Cypress dev server logs for the requests in the application:
This is not a major issue. I don't think it's blocking anyone. The Note that the Angular application is correctly served with either path. I updated the shared repo to showcase this as well. The branch https://github.com/leosvelperez/ng-cypress-ct-issue/tree/standard-assets-dir has the standard |
We are also facing this issue and it's causing our component tests to fail. Any help from Cypress team would be appreciated! |
Would be great if someone could help here |
Same issue here as well Raised an issue NX side that has a repro in #27344 but looking at other reports on the NX page, seems to be a Cypress issue (which is how i found this thread) |
Same issue here, happened since we switched to the ESBuild builder. By the way it seems that Cypress CT Angular always uses Webpack under the hood, wouldn't it be better to switch to ESBuild if the Angular app is configured to use ESBuild ? I can help on that if I have some guidance |
Could someone please take a look? We would like to start with component testing, but it's super distracting when both terminal and console are flooded with errors, because the assets couldn't be resolved. |
Any progress on this issue, or any workaround ? |
Sadly not. It's still blocking us from using the component tests, as the viewport looks completely broken and the terminal is spammed with errors. |
Current behavior
When running Cypress CT on an Angular project where assets are copied from a directory structure other than
<project-root>/src/assets
to/assets
(probably when the number of path segments is different between source and destination), the assets can't be resolved from stylesheets. Serving the application works correctly.When running Cypress CT (
ng run <project>:ct
), the image is not displayed and an error is printed in the terminal:Desired behavior
Running Cypress CT on an Angular project should work correctly and resolve assets regardless of their directory structure as long as their configuration is correct and they work when serving the application.
Test code to reproduce
Repo: https://github.com/leosvelperez/ng-cypress-ct-issue
Reproduction steps:
Cypress Version
13.8.1
Node version
v20.12.0
Operating System
macOS 14.4.1
Debug Logs
No response
Other
No response
The text was updated successfully, but these errors were encountered: