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

ng-generate: fails if @schematics/angular is not installed #18529

Open
pburkindine opened this issue Feb 17, 2020 · 5 comments
Open

ng-generate: fails if @schematics/angular is not installed #18529

pburkindine opened this issue Feb 17, 2020 · 5 comments
Assignees
Labels
area: ng-add Issues related to `ng-add` integration area: ng-generate Schematics that generate code in user projects area: ng-update Issues related to `ng-update` integration blocked This issue is blocked by some external factor, such as a prerequisite PR P4 A relatively minor issue that is not relevant to core functions

Comments

@pburkindine
Copy link

Bug, enhancement request, or proposal:

Received error An unhandled exception occurred: Cannot find module '@schematics/angular/utility/ast-utils' while performing A9 upgrade, "@angular-devkit/schematics": "^9.0.2", "@angular/cli": "9.0.2",

@pburkindine
Copy link
Author

Resolved by adding dep for @schematics/angular

Desired resolution is either ng update checks for this missing dep or else add to the update script on https://update.angular.io/

@Splaktar
Copy link
Member

Please submit Angular Material and CDK questions here and issues here. This repo is for AngularJS Material.

I have transferred this issue to the correct repository for you.

@Splaktar Splaktar transferred this issue from angular/material Feb 17, 2020
@devversion
Copy link
Member

devversion commented Mar 2, 2020

We no longer import AST utils from @schematics/angular, so this should no longer be an issue for ng update. Though, our generate schematics still rely on @schematics/angular. We could:

  1. Spend time figuring out where we can have shared schematic logic.
  2. Add @schematics/angular as explicit dependency to the CDK.
  3. Always assume that @schematics/angular is installed, and print a good error if it's not installed for some reason.

@jelbourn I'd prefer (1) since we need it for @angular/core too. For components, going with (2) would be fine too. One concern might be that the package is unnecessarily downloaded in some situations. Though it's definitely correct to have it as dependency if we directly access it. If we go with (1), we'd most likely still need an dependency on @schematics/angular too.

I created a ticket for working this out long-term: COMP-295. We can defer this until the overall decision is made (and applies for framework too). The ng update issue has been solved, and it's only a rare issue for ng generate now.

@devversion devversion added the P4 A relatively minor issue that is not relevant to core functions label Mar 2, 2020
@devversion devversion changed the title missing ast-utils during A9 upgrade ng-generate: fails if @schematics/angular is not installed Mar 2, 2020
@pburkindine
Copy link
Author

Apologies for posting to the wrong repo, been a long week! Thanks for getting on this

@devversion devversion added area: ng-update Issues related to `ng-update` integration area: ng-add Issues related to `ng-add` integration and removed area: ng-update Issues related to `ng-update` integration labels May 25, 2020
@devversion devversion added the blocked This issue is blocked by some external factor, such as a prerequisite PR label May 25, 2020
@devversion
Copy link
Member

This is blocked on us figuring out how schematic utilities should be shared across Angular packages.

@devversion devversion added the area: ng-generate Schematics that generate code in user projects label May 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: ng-add Issues related to `ng-add` integration area: ng-generate Schematics that generate code in user projects area: ng-update Issues related to `ng-update` integration blocked This issue is blocked by some external factor, such as a prerequisite PR P4 A relatively minor issue that is not relevant to core functions
Projects
None yet
Development

No branches or pull requests

3 participants