-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
readTargetOptions
devkit's function not working on Angular Workspace
#14413
Comments
This is blocking a widely used extension to deploy Nx libraries bikecoders/ngx-deploy-npm#454, many depend on it. Any help would be appreciated 😄 |
hey @dianjuar! Apologies for the delay in addressing this. A PR has been merged that solves this issue for now. The fix is not specific to this issue, but rather a separate fix that happens to address what you are facing. Just so you know, while most of the Nx DevKit functionality has been working so far in Angular CLI workspaces, the Nx DevKit is not intended to be compatible with or support Angular CLI workspaces. It does contain some utilities to convert Nx generators and executors into Angular CLI schematics and builders, but that's only to consume those in Nx workspaces. That's to allow folks with Nx workspaces migrated from Angular CLI workspaces and using custom schematics and builders to compose existing Nx generators and executors. That way, they don't need to rewrite their schematics and builders using Nx DevKit immediately and can do it whenever they are ready. Those conversion utilities are not meant to produce fully compliant schematics and builders for Angular CLI workspaces. They are meant to produce schematics and builders that can be used in Nx workspaces. If you need a schematic or builder to be used in Angular CLI workspaces, the safest and recommended thing to do is to write them using the Angular CLI DevKit. You could still potentially use the Nx DevKit, but keeping in mind that things can break without any notice and they shouldn't be considered issues because it's not something we support or intend to support. |
This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context. |
Current Behavior
readTargetOptions
from@nrwl/devkit
is triggering an error on Angular Workspaces.Debugging the code, the problem is because
context.projectGraph.nodes
is empty, and when it's trying to executecontext.projectGraph.nodes[project].data
is causes an error becausedata
doesn't exist onundefined
.Expected Behavior
It should be able to call
readTargetOptions
without any problem as it was doing on previous versionsGithub Repo
https://github.com/bikecoders/ngx-deploy-npm
Steps to Reproduce
You will need to run an Nx Plugin executor on an Angular Workspace. That executor must use the function
@nrwl/devkit/readTargetOptions
.I have a simple script to test this behavior on ngx-deploy-npm, you can use it to reproduce the problem quickly
git clone https://github.com/bikecoders/ngx-deploy-npm
git checkout migrate-nx-15-4
yarn install
npx build
./tools/create-angular-workspace.sh
Nx Report
Failure Logs
Additional Information
Failing Log
https://github.com/bikecoders/ngx-deploy-npm/actions/runs/3936177517/jobs/6732526464
Angular Workspace
The Angular Workspace tested has the following characteristics:
The text was updated successfully, but these errors were encountered: