Skip to content
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

Fix/issue 22747 #28134

Closed
wants to merge 2 commits into from
Closed

Fix/issue 22747 #28134

wants to merge 2 commits into from

Conversation

wiegell
Copy link

@wiegell wiegell commented Oct 24, 2023

  • Closes

Additional details

Steps to test

How has the user experience changed?

PR Tasks

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@cypress-app-bot
Copy link
Collaborator

@@ -324,6 +326,8 @@ export class ProjectConfigIpc extends EventEmitter {
} else {
childOptions.env.NODE_OPTIONS = tsNodeLoader
}

childOptions.env['NODE_OPTIONS'] = `--require ${this.projectRoot}/.pnp.cjs ${ childOptions.env['NODE_OPTIONS']}`
Copy link
Author

@wiegell wiegell Oct 24, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line alone fixes #22747, but only if webpack-dev-server is not used (e.g. global mode yarn cypress:open --project xxx and testing an external angular project run via ng serve)

@@ -584,7 +584,7 @@ describe('Launchpad: Setup Project', () => {
// TODO: Had to revert due to regression: https://github.com/cypress-io/cypress/pull/26452
// Would be great to fully support Plug n Play eventually, but right now it causes issues relating
// to not correctly detecting dependencies when installing the binary.
it.skip('works with Yarn 3 Plug n Play', () => {
it.only('works with Yarn 3 Plug n Play', () => {
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have tried reworking this test to feature an angular repo that should be spun up via cypress. I have run into some other pnp-related issues, that could be mitigated, but i'm stuck at an esm import error deep in the angular_devkit/build package

 cypress:lifecycle:ProjectConfigIpc plugins process error: Error [ERR_MODULE_NOT_FOUND]: Cannot find package '@angular/compiler-cli' imported from /private/var/folders/hg/3s1q3w8j4xlgbp55q9cbsnkm0000gn/T/cy-projects/yarn-v3.1.1-pnp/.yarn/__virtual__/@angular-devkit-build-angular-virtual-4aa3a8673f/0/cache/@angular-devkit-build-angular-npm-16.2.7-ff0a3596ac-cfd587b125.zip/node_modules/@angular-devkit/build-angular/src/utils/load-esm.js
[cy:open:dev:30509]: Did you mean to import @angular-compiler-cli-virtual-8bb163dda9/0/cache/@angular-compiler-cli-npm-16.2.10-071c53740f-07c89fc8a0.zip/node_modules/@angular/compiler-cli/bundles/index.js?
[cy:open:dev:30509]:     at new NodeError (node:internal/errors:399:5)
[cy:open:dev:30509]:     at packageResolve (node:internal/modules/esm/resolve:895:9)
[cy:open:dev:30509]:     at moduleResolve (node:internal/modules/esm/resolve:944:20)
[cy:open:dev:30509]:     at defaultResolve (node:internal/modules/esm/resolve:1159:11)
[cy:open:dev:30509]:     at nextResolve (node:internal/modules/esm/loader:163:28)
[cy:open:dev:30509]:     at ESMLoader.resolve (node:internal/modules/esm/loader:838:30)
[cy:open:dev:30509]:     at ESMLoader.getModuleJob (node:internal/modules/esm/loader:424:18)
[cy:open:dev:30509]:     at ESMLoader.import (node:internal/modules/esm/loader:525:22)
[cy:open:dev:30509]:     at importModuleDynamically (node:internal/modules/cjs/loader:1193:29)
[cy:open:dev:30509]:     at importModuleDynamicallyWrapper (node:internal/vm/module:429:21)
[cy:open:dev:30509]:     at importModuleDynamically (node:internal/vm:106:46)
[cy:open:dev:30509]:     at importModuleDynamicallyCallback (node:internal/process/esm_loader:35:14)
[cy:open:dev:30509]:     at eval (eval at loadEsmModule (/private/var/folders/hg/3s1q3w8j4xlgbp55q9cbsnkm0000gn/T/cy-projects/yarn-v3.1.1-pnp/.yarn/__virtual__/@angular-devkit-build-angular-virtual-4aa3a8673f/packages/angular_devkit/build_angular/src/utils/load-esm.ts:24:10), <anonymous>:3:1)
[cy:open:dev:30509]:     at loadEsmModule (/private/var/folders/hg/3s1q3w8j4xlgbp55q9cbsnkm0000gn/T/cy-projects/yarn-v3.1.1-pnp/.yarn/__virtual__/@angular-devkit-build-angular-virtual-4aa3a8673f/packages/angular_devkit/build_angular/src/utils/load-esm.ts:24:66)
[cy:open:dev:30509]:     at readTsconfig (/private/var/folders/hg/3s1q3w8j4xlgbp55q9cbsnkm0000gn/T/cy-projects/yarn-v3.1.1-pnp/.yarn/__virtual__/@angular-devkit-build-angular-virtual-4aa3a8673f/packages/angular_devkit/build_angular/src/utils/read-tsconfig.ts:29:71)
[cy:open:dev:30509]:     at generateWebpackConfig (/private/var/folders/hg/3s1q3w8j4xlgbp55q9cbsnkm0000gn/T/cy-projects/yarn-v3.1.1-pnp/.yarn/__virtual__/@angular-devkit-build-angular-virtual-4aa3a8673f/packages/angular_devkit/build_angular/src/utils/webpack-browser-config.ts:46:38)
[cy:open:dev:30509]:     at generateBrowserWebpackConfigFromContext (/private/var/folders/hg/3s1q3w8j4xlgbp55q9cbsnkm0000gn/T/cy-projects/yarn-v3.1.1-pnp/.yarn/__virtual__/@angular-devkit-build-angular-virtual-4aa3a8673f/packages/angular_devkit/build_angular/src/utils/webpack-browser-config.ts:158:24)
[cy:open:dev:30509]:     at async getAngularCliWebpackConfig (/Users/<USER>/cypress/npm/webpack-dev-server/dist/helpers/angularHandler.js:193:24)
[cy:open:dev:30509]:     at async angularHandler (/Users/<USER>/cypress/npm/webpack-dev-server/dist/helpers/angularHandler.js:233:27)
[cy:open:dev:30509]:     at async getPreset (/Users/<USER>/cypress/npm/webpack-dev-server/dist/devServer.js:94:20)
[cy:open:dev:30509]:     at async Function.devServer.create (/Users/<USER>/cypress/npm/webpack-dev-server/dist/devServer.js:111:61)
[cy:open:dev:30509]:     at async /Users/<USER>/cypress/npm/webpack-dev-server/dist/devServer.js:26:24

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants