I seem to lost the ability to use the Angular CLi to generate a component.
ng g c test-modal-component
Gives the error that the project missing.
Data path "" must have required property 'project'.
What I noticed is the removal of "defaultProject": "abp-zero-template" since it was deprecated and Angular update, I am sure removed it. I can add the --project to the cli call and it works. Was trying to see if anyone else find why the default project name is not being resolved.
6 Answer(s)
-
0
Hi,
Thank you for your report. Probably this is removed accidentally, we will work on this via https://github.com/aspnetzero/aspnet-zero-core/issues/4888
-
0
It seems like we should use
--project
parameter , see https://github.com/angular/angular-cli/issues/23470 -
0
Some more updates to this.
Yes using the --project parameter works. But this is supposed to be optional.
I tried a blank Angular application created using the CLI and in there the ng g c works fine. The also don't have the defaultProject field in the angular.json.
I am doing so comparing to see what is different in the rest of the file.
-
0
Hi,
I think that is becuase a default Angular project creates a folder with the projetc name but ASP.NET Zero's angular version doesn't have this folder. We will consider creating this folder but we need to be sure we will handle breaking changes smoothly.
-
0
Actually, I found the issue.
In angular.json, you guys define two projects.
abp-zero-template and abp-zero-template-e2e
So, it makes sense now that the defaultProject is not being defined it does not know which project to choose when creating components. So now you must pass the flag --project to tell the cli which project to use. I don't see where that second project is being used anymore. If it's for protactor, that is deprecated so maybe that can be removed?
Protractor is deprecated and will reach end-of-life in August 2023.
-
0
You are probalby right, I have reopened the issue and we will work on this. Since we are already using Playwright for the UI tests, I tihnk it will be OK to remove
abp-zero-template-e2e
project.