jscutlery / devkit

Cutleries to help you cook better apps
MIT License
247 stars 15 forks source link

The "path" argument must be of type string. Received undefined. #104

Open kerry-afs opened 3 years ago

kerry-afs commented 3 years ago

Hey there,

We're using Nx in our project, and when attempting to run the command nx g @jscutlery/cypress-angular:setup-ct --project projectName, I get the following output:

The "path" argument must be of type string. Received undefined."

That is the extent of the output on my end with no additional details, so it's been challenging trying to find a root cause. Has anyone experienced this before and have insight on how to rectify this? Thanks in advance.

Versions:

edbzn commented 3 years ago

Hello, I just tried with a workspace version 12.10.0 and I was not able to reproduce it, I will need more details or a reproduction.

kerry-afs commented 3 years ago

Thanks for the quick response! Let me try and build a project really quickly to repro the issue and share the repository.

kerry-afs commented 3 years ago

I was able to bypass this (manually) by setting up my plugins/index.ts, settings/index.ts, angular.json and cypress.json files accordingly. That seems to allow the project to build; however, on running nx run project-e2e:ct it fires up the Cypress instance, but then hangs. The runner is not visible, and the only output (even when passing the --verbose flag) is:

> nx run project-e2e:ct 
NOTE:
You can now remove the use of the '--headless' flag.
If your run depends on a Chrome extension being loaded during 'cypress run', you should explicitly pass the '--headed' flag.

If you are trying to execute 'cypress open', you should pass the '--watch' flag instead.

Is there a way for me to view the output so I can determine where this might be hanging? When I attempt to reproduce it with similar settings in the new Nx project I fired up, it seems to be fine, so I'm at a loss.

I also understand this issue is separate from the bug I logged, so if a new bug is needed for help here, I am happy to log a new one. 😄

edbzn commented 3 years ago

You're able to reproduce the first issue with a clean workspace? I want to be sure the setup works correctly before digging into the executor.

edbzn commented 3 years ago

By any chance your repo is accessible?

kerry-afs commented 3 years ago

I was not. It worked as expected in the clean workspace, so that was good! There were a couple of items I noticed in the new workspace that is different than how our monorepo generally works:

kerry-afs commented 3 years ago
...on running nx run project-e2e:ct it fires up the Cypress instance, but then hangs. The runner is not visible, and the only output (even when passing the --verbose flag) is:

> nx run project-e2e:ct 
NOTE:
You can now remove the use of the '--headless' flag.
If your run depends on a Chrome extension being loaded during 'cypress run', you should explicitly pass the '--headed' flag.

If you are trying to execute 'cypress open', you should pass the '--watch' flag instead.

Alright, I think I may have figured out what the issue is with the above. I found that this occurs once I add Webpack 5 to the project (which my team is using). I've filled out a new bug for that issue at #106

azaeng04 commented 2 years ago

@kerry-afs I am also getting this error, but I do not have Webpack 5 installed as a dev dependency. I just have the latest v12 of Angular installed. and v5.5.0 of html-webpack-plugin.

Foxandxss commented 2 years ago

I installed a new workspace with only angular (nx 14.4.2). Brand new, I installed this package and tried to setup it and I got the error.