Cypress and Yarn 2 PNP support
See original GitHub issueCurrent behavior:
In Yarn 2 monorepo I have a package a
and tests in package b
.
When I do
// b/cypress/plugins/index
module.exports = require('a/src/cypress/plugins');
It works as expected.
But
// a/cypress/commands/index
require('a/src/cypress/commands');
Fails with error:
Oops...we found an error preparing this test file:
/Users/xxx/b/cypress/support/index.js
The error was:
Error: Cannot find module 'a/src/cypress/support' from '/Users/xxx/b/cypress/support'
Looks like Yarn’s Plug’n’play file .pnp.js
is not present in second (commands) context.
Desired behavior:
Require of monorepo packages should work.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:18
- Comments:29 (8 by maintainers)
Top Results From Across the Web
Resolving Yarn2 + Cypress GitHub Action: Cannot find ...
I contributed a request to the original issue to support Yarn's .pnp.cjs file, which should patch require.resolve to find modules installed using Plug...
Read more >How can Webpack 5 polyfills resolve with Yarn 2 PnP? ...
Turns out that the path polyfill for Webpack 5 is working fine with Yarn 2. The issue is that the package itself, cypress-dark, ......
Read more >cypress | Yarn - Package Manager
Fast, easy and reliable testing for anything that runs in a browser. What is this? Cypress comes packaged as an npm module, which...
Read more >Changelog
This will make the run faster and help mitigate #21743. Fixes #24919. 12.0.2. Released 12/08/2022. Bugfixes: Fixed a regression in ...
Read more >Hello Yarn 2, Goodbye Node_modules. | by Friedrich Politz
Plug'n'Play support isn't the only big change coming with Yarn 2 (the concept in ... Yarn now holds a map inside a single...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Cypress should support built-in yarn 2 (PNP algorithm) and it’s really important. We use yarn 2 for the zero-install feature to improve our CI build time, and If we use nodeLinker, we miss that feature.
+1 for this please. I’m currently completely unable to write my integration tests or any code related to it in TypeScript in my otherwise entirely TypeScript based yarn2/pnp project.