-
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 v13: Can't resolve '@cypress/code-coverage/support' using Yarn PnP #27947
Comments
This issue is also reproducible with:
Cypress has multiple unresolved compatibility issues with Yarn Modern Plug'n'Play at this time, especially for Component Testing. If you need to migrate to Cypress yarn config set nodeLinker node-modules
yarn install then yarn cypress run should work. |
Thanks for this! Any plans to fully support So that we can get the benefits of "zero-installs". 😄 |
@wataruian i'm also waiting for better pnp support. const { nxE2EPreset } = require('@nx/cypress/plugins/cypress-preset');
const { defineConfig } = require('cypress');
module.exports = defineConfig({
e2e: { ...nxE2EPreset(__dirname), baseUrl: 'https://localhost:4300' },
}); There is an issue regarding that here: #22747 |
@wiegell thanks for sharing this! I too am waiting for seamless PnP support. For now, I'll just go with v12. |
Careful with unspecific v12, since 12.17.4 has another pnp-bug :) |
I can confirm that with yarn4 and NX17 I'm getting an error (none of the cypress@12 and cypress@13 seem to be working) right now for me so upgrade to yarn4 is broken
|
This issue has not had any activity in 180 days. Cypress evolves quickly and the reported behavior should be tested on the latest version of Cypress to verify the behavior is still occurring. It will be closed in 14 days if no updates are provided. |
This issue has been closed due to inactivity. |
Hey folks, im seeing a similar issue when using a project with pnp, i've tried with latest release but still have similar issues did anyone resolve this or is this in development pipeline in 13.x? should i open a new tracking issue for this if not? |
Possibly related to this change in 13.0.0? #27583 |
@jennifer-shehane we think so too. We theorized that upgrading enhanced-resolve to 5.17.0 might fix the issue, but I was unable to test locally. |
Since this issue doesn't provide one, and I put in the effort, I'm going to put my minimum reproducible example on here: https://github.com/dclowd9901/cypress-13-yarn-pnp-workspace-bug-minimum-reproducible-example/blob/main/README.md |
I had a little bit of time to take a look at the issue this morning. Going to jot down some of my notes... With the reproduction provided:
Likely this has to do with the webpack 5 update to the preprocessor since webpack 5 is supposed to handle pnp resolutions OOTB. But when the webpack compiler attempts to compile the file, the dependencies can’t be found. This might be an issue with my local setup since I am running yarn 1.22.1 on the cypress project against a project with yarn 4 / pnp. Maybe since webpack believes it can auto resolve pnp, and sees yarn 1.22.1, it figures pnp may not be enabled. It might be worth it to edit the web pack-preprocessor / webpack-batteries-included-preprocessor from the actual installed binary and debug the code that way since we know we are running on the correct yarn. However the cache directories are all zip files which might make debugging challenging. Hoping to look at this more later this week. |
Darn, was really hoping for it to be an easy fix there. Unplugging that dependency might be a cheap and quick way to "unzip" the packages you're wanting to debug? Anyway, happy to bounce ideas -- I'm on Discord at |
its a bit complicated since cypress installs as an npm package, but ultimately executes a binary that lives in the cache directory, which ships with the |
This looks like it might be an issue with webpack 5. Before in webpack 4, we were able to discover |
Good news @dclowd9901 . I actually messed up the original attempt at fixing this and updated |
Awesome. For our part, I'll pull down the commit and check it on our stuff. |
I think that is the wrong binary. can you try npm install https://cdn.cypress.io/beta/npm/13.13.2/darwin-arm64/fix/webpack-batteries-included-for-yarn-pnp-5345c1b2bfad7f1b0b6949c569d63e3507a0873f/cypress.tgz? |
Released in This comment thread has been locked. If you are still experiencing this issue after upgrading to |
Current behavior
When importing
@cypress/code-coverage/support
in the support file like this:cypress/support/e2e.ts
:cypress
is throwing an error:But when the import is removed,
cypress
is working fine but is not desired since code coverage functionality will also be removed.The error occurred after updating to
^13.3.0
, everything is working fine on^12.17.1
with Yarn PnP (3.5.0
).Desired behavior
Code coverage should work regardless of the cypress version using Yarn PnP.
Test code to reproduce
@cypress/code-coverage/support
in the support fileCypress Version
^13.3.0
Node version
v18.15.0
Operating System
Apple M2 Pro: macOS 13.5.2 (22G91)
Debug Logs
No response
Other
No response
The text was updated successfully, but these errors were encountered: