-
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 run fails when installed using yarn 3.x on apple silicon mac #27542
Comments
Do you still get the error message "Error: Your application tried to access @opentelemetry/resources, but it isn't declared in your dependencies; this makes the require call ambiguous and unsound." if you run Cypress under Yarn Modern with
instead of
What happens if you set up Yarn Modern for nodeLinker |
I still get the same error when running with "yarn run local:run" However after I run "yarn config set nodeLinker node-modules", then either "yarn run local:run |
Thanks for your test! So now we know that the issue occurs only on Yarn Modern (Version 3) in Plug'n'Play mode, which is the default mode for new installations. I tried to reproduce on a The spec for the GitHub runner was
so not Apple Silicon. (See Supported runners and hardware resources.) Somebody with a Silicon macOS system ( Edit: Added the information that the GitHub runner was
|
I'm getting this on Ubuntu 22.04 |
Do you have any more details:
|
Thanks Mike, let me know if there's any more info you need.
|
Many thanks for your details! I wasn't able to reproduce this using the simple E2E / Electron command in an environment aimed to match your local Ubuntu environment: yarn cypress run What command did you run when this error occurred? I assume from your logs that you are using Yarn Plug'n'Play and if you execute yarn config get nodeLinker it would show
Let me know if I got that wrong! |
I get these errors when I run Might be relevant info that this is for a local install of cypress in the project, not a global install maybe? |
I am getting the error too. But have been for a long time and haven't had the time to look into it until today.
This is my company's mono-repo so I cannot change the nodeLinker with a lot of push back. |
Many thanks for your inputs! The common theme is the error message similar to
on Yarn Modern Plug'n'Play running Cypress E2E testing. This is a Yarn pnp Semantic erroring output and this points to it being a compatibility issue between Cypress and Yarn Plug'n'Play. The error has been reported on different operating systems and different versions. I have however not been able to reproduce it myself and I am not seeing it under GitHub Actions. You are welcome to cross-check using a simple E2E project from one of the Cypress example directories which is correctly configured for Yarn Modern Plug'n'Play: git clone https://github.com/cypress-io/github-action
cd github-action/examples/yarn-modern-pnp
yarn
yarn test The example produces no error when run on GitHub (see https://github.com/cypress-io/github-action/actions/workflows/example-yarn-modern-pnp.yml?query=branch%3Amaster) or if I run it locally under Ubuntu 22.04 or Window 11. I also went back to the steps to reproduce in the original posting and I could not reproduce it using https://github.com/cypress-io/cypress-example-kitchensink either, although that repo is not ideal for testing against Yarn, since it is configured for npm usage, not for Yarn. |
In other similar non-reproducible situations the response from Yarn Modern was to check that you do not have a |
All three files to include |
For some reason, I am the only dev on this project of 100s that is having this issue. Could it be a file permission issue in the Cypress cache? A browser plugin? Or the configuration I have between nvm, node, npm, yarn, and cypress? |
I was trying to run a script that was calling I just tried changing directory into my package's root folder inside the mono-repo and I was able to get cypress to open with
Could this be due to cypress not knowing how to handle |
The reference to home folder meant your personal home folder, not the root folder of the repository. |
If you are the only dev with the issue, it does suggest that there is something wrong with your environment. |
You've raised another issue here, and if you think you've found a bug, then it would be better to open a new issue as it depends very much on how exactly your repo is set up, so you would need to provide more details or better still an example public repo which demonstrates your issue.
According to References > Configuration > Configuration File
So, no, this is not a general problem. |
I had a |
That is a great success! It's a really weird error message to receive for that misconfiguration error. I would not have thought of this root cause myself. I just found it in the Yarn issue list and thought it might apply. |
It's a long time ago since you submitted this issue. Is this still something that you are experiencing or has it been resolved? I would tend to suggest closing this issue now, as it seems to be caused by user-side Yarn Plug'n'Play misconfiguration, not a bug in Cypress. |
I also had one in my ~/ and removing it moved me past this. Thanks for the help Mike! |
Good to hear that the same fix helped you too! I don't know if a check in Cypress for this issue would be the right place to put it. That could be the subject of a separate enhancement request anyway. Perhaps it would make more sense for Yarn Modern to do the checking or at least add the gotcha to their documentation? |
It was a local cache issue. This issue can be resolved. |
Thanks very much for the confirmation! Since you are the Author, you can close your own issue using the button below 🔽 . |
Current behavior
Running cypress 12.x installed using yarn 3.x on Apple Silicon causes "Your application tried to access @opentelemetry/resources, but it isn't declared in your dependencies; this makes the require call ambiguous and unsound."
Desired behavior
"yarn run cypress run" should not have any issue on "Your application tried to access @opentelemetry/resources, but it isn't declared in your dependencies; this makes the require call ambiguous and unsound" when installed using yarn 3.x on Apple Silicon Mac
Test code to reproduce
Yarn 1.22.x (working)
mkdir /tmp/cypress-example-kitchensink_yarn1x
cd /tmp/cypress-example-kitchensink_yarn1x
git clone https://github.com/cypress-io/cypress-example-kitchensink.git
cd cypress-example-kitchensink
verify yarn version is 1.22.x with yarn --version
yarn install
yarn run cypress run
You get " Running: 1-getting-started/todo.cy.js (1 of 20)"
Yarn 3.x (Not working)
mkdir /tmp/cypress-example-kitchensink_yarn3x
cd /tmp/cypress-example-kitchensink_yarn3x
git clone https://github.com/cypress-io/cypress-example-kitchensink.git
cd cypress-example-kitchensink
switch to yarn 3.x
yarn set version berry or
yarn set version 3.0.1
verify yarn version is 3.x with yarn --version
yarn install
yarn run cypress run
You get the following error message
Error: Your application tried to access @opentelemetry/resources, but it isn't declared in your dependencies; this makes the require call ambiguous and unsound.
cypress run output
yarn run cypress run
(node:14330) [MODULE_NOT_FOUND] Error: debug tried to access supports-color (a peer dependency) but it isn't provided by its ancestors; this makes the require call ambiguous and unsound.
(Use
node --trace-warnings ...
to show where the warning was created)[14331:0812/201925.935593:ERROR:node_bindings.cc(279)] Most NODE_OPTIONs are not supported in packaged apps. See documentation for more details.
[14331:0812/201925.935610:ERROR:node_bindings.cc(279)] Most NODE_OPTIONs are not supported in packaged apps. See documentation for more details.
[14331:0812/201925.935614:ERROR:node_bindings.cc(279)] Most NODE_OPTIONs are not supported in packaged apps. See documentation for more details.
[14331:0812/201925.935616:ERROR:node_bindings.cc(279)] Most NODE_OPTIONs are not supported in packaged apps. See documentation for more details.
DevTools listening on ws://127.0.0.1:49377/devtools/browser/9349252f-b218-422b-96a8-333b9339c723
/private/tmp/cypress-example-kitchensink_yarn3x/.pnp.cjs:22522
Error.captureStackTrace(firstError);
^
Error: Your application tried to access @opentelemetry/resources, but it isn't declared in your dependencies; this makes the require call ambiguous and unsound.
Required package: @opentelemetry/resources
Required by: /Users/tonychia/Library/Caches/Cypress/12.17.3/Cypress.app/Contents/Resources/app/packages/telemetry/dist/
Require stack:
at require$$0.Module._resolveFilename (/private/tmp/cypress-example-kitchensink_yarn3x/.pnp.cjs:22522:13)
at Module._load (node:internal/modules/cjs/loader:901:27)
at require$$0.Module._load (/private/tmp/cypress-example-kitchensink_yarn3x/.pnp.cjs:22411:31)
at Module.require (node:internal/modules/cjs/loader:1115:19)
at require (node:internal/modules/helpers:130:18)
at Object. (/Users/tonychia/Library/Caches/Cypress/12.17.3/Cypress.app/Contents/Resources/app/packages/telemetry/dist/node.js:4:21)
at Module._compile (node:internal/modules/cjs/loader:1233:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1287:10)
at require$$0.Module._extensions..js (/private/tmp/cypress-example-kitchensink_yarn3x/.pnp.cjs:22566:33)
at Module.load (node:internal/modules/cjs/loader:1091:32)
Cypress Version
12.17.3
Node version
v14.21.2, v18.7.0
Operating System
Mac OSX 13.4.1
Debug Logs
No response
Other
No response
The text was updated successfully, but these errors were encountered: