Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upSchematics: Schematic fails with cryptic error when a project is not specified #2004
Comments
|
Hi @brandonroberts, I've done some testing and I'm getting some different results than in the description. I think this is due to the fact that this is with the older version then I'm testing right now. I've done the setup removed the first generated app, and created a second one. This is still similar as you explained.
The error message is a valid message but I believe this is not the situation you would like to be resolved. After seeing this error message I've removed the
The error above is also valid as we have a function in the As I cannot reproduce this issue I just looked at the code and thought of making the following change.
to:
However, I'm not quite happy with this, because |
Copied from: nrwl/nx#1545
Please make sure you have read the submission guidelines before posting an issue
Expected Behavior
Please describe the behavior you are expecting
When running the below command without a
--projectflag, I expect the error message to reflect the missing flag, instead of the messageCannot read property 'root' of undefined, as it is non-descriptive. The command I ran:The message could be improved by something like:
Current Behavior
What is the current behavior?
The current behavior is that when running the above command, it does not generate the expected files. Instead, it presents the non-descriptive error message
Cannot read property 'root' of undefined. When running the below command, it does generate the expected files.Note that
my-angular-projectshould obviously be defined in youangular.jsonfile.Failure Information (for bugs)
Please help provide information about the failure if this is a bug. If it is not a bug, please remove the rest of this template.
Steps to Reproduce
Please provide detailed steps for reproducing the issue.
my-workspaceand be sure to include an Angular projectmy-different-angular-project.Context
Please provide any relevant information about your setup:
"@nrwl/workspace": "8.2.0"
@angular/[email protected]
angular.jsonconfigurationCan't share
"@angular-devkit/build-angular": "^0.800.0",
@ngrx/schematics": "^8.0.1"
See the above reproduction steps.
A minimal reproduce scenario using allows us to quickly confirm a bug (or point out coding problem) as well as confirm that we are fixing the right problem.
Failure Logs
Please include any relevant log snippets or files here.
Other
Any other relevant information that will help us help you.
According to this issue, it could be caused by a mismatch between the Angular Project name in
angular.jsonand the name used inpackage.json, but I'm not sure about that.