Skip to content

Show nice error when attempting to ng-add something that doesn't exist #10467

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

Closed
StephenFluin opened this issue Apr 26, 2018 · 1 comment · Fixed by #10488
Closed

Show nice error when attempting to ng-add something that doesn't exist #10467

StephenFluin opened this issue Apr 26, 2018 · 1 comment · Fixed by #10488
Labels
P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent
Milestone

Comments

@StephenFluin
Copy link
Contributor

Versions

Angular CLI: 6.0.0-rc.6

Repro steps

ng new my-app
cd my-app
ng add @angular/[email protected]

Observed behavior

Installed packages for tooling via npm.
Cannot read property 'startsWith' of undefined
TypeError: Cannot read property 'startsWith' of undefined
    at NodeModulesEngineHost._resolvePath (/super/workspace/test/material-test/node_modules/@angular-devkit/schematics/tools/node-module-engine-host.js:31:18)
    at NodeModulesEngineHost._resolveCollectionPath (/super/workspace/test/material-test/node_modules/@angular-devkit/schematics/tools/node-module-engine-host.js:69:35)
    at NodeModulesEngineHost.createCollectionDescription (/super/workspace/test/material-test/node_modules/@angular-devkit/schematics/tools/file-system-engine-host-base.js:106:27)
    at SchematicEngine._createCollectionDescription (/super/workspace/test/material-test/node_modules/@angular-devkit/schematics/src/engine/engine.js:78:40)
    at SchematicEngine.createCollection (/super/workspace/test/material-test/node_modules/@angular-devkit/schematics/src/engine/engine.js:71:43)
    at Object.getCollection (/super/workspace/test/material-test/node_modules/@angular/cli/utilities/schematics.js:28:31)
    at AddCommand.getOptions (/super/workspace/test/material-test/node_modules/@angular/cli/models/schematic-command.js:187:41)
    at AddCommand.<anonymous> (/super/workspace/test/material-test/node_modules/@angular/cli/commands/add.js:29:49)
    at Generator.next (<anonymous>)
    at /super/workspace/test/material-test/node_modules/@angular/cli/commands/add.js:7:71

Desired behavior

Show a friendly error message that we couldn't find any schematics in the referenced package.

@StephenFluin StephenFluin added the P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent label Apr 26, 2018
@StephenFluin StephenFluin added this to the v6.0.0 milestone Apr 26, 2018
@hansl hansl self-assigned this Apr 26, 2018
hansl added a commit to hansl/devkit that referenced this issue Apr 26, 2018
clydin pushed a commit to angular/devkit that referenced this issue Apr 26, 2018
hansl added a commit to hansl/angular-cli that referenced this issue Apr 27, 2018
…hematics

Does not show a better error if there are schematics but ng-add isnt found. That will
simply show "schematics ng-add not found" or something alike, which is fine here.

fixes angular#10467
hansl added a commit to hansl/angular-cli that referenced this issue Apr 27, 2018
…hematics

Does not show a better error if there are schematics but ng-add isnt found. That will
simply show "schematics ng-add not found" or something alike, which is fine here.

fixes angular#10467
hansl added a commit that referenced this issue Apr 27, 2018
…hematics

Does not show a better error if there are schematics but ng-add isnt found. That will
simply show "schematics ng-add not found" or something alike, which is fine here.

fixes #10467
hansl added a commit that referenced this issue Jun 6, 2018
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 8, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants