Skip to content

defaultCollection is relative to where cmd is run not angular.json #15014

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
mina-skunk opened this issue Jul 8, 2019 · 2 comments
Closed

defaultCollection is relative to where cmd is run not angular.json #15014

mina-skunk opened this issue Jul 8, 2019 · 2 comments
Labels
area: @angular-devkit/schematics freq1: low Only reported by a handful of users who observe it rarely severity3: broken type: bug/fix
Milestone

Comments

@mina-skunk
Copy link

mina-skunk commented Jul 8, 2019

🐞 Bug report

Command (mark with an x)

- [ ] new
- [ ] build
- [ ] serve
- [ ] test
- [ ] e2e
- [X] generate
- [ ] add
- [ ] update
- [ ] lint
- [ ] xi18n
- [ ] run
- [ ] config
- [ ] help
- [ ] version
- [ ] doc

Is this a regression?

I'm not sure

Description

With defaultCollection set to a relative path if ng g is ran in a sub folder it is not found.

🔬 Minimal Reproduction

🔥 Exception or Error


Collection "./tools/schematics/collection.json" cannot be resolved.
Error: Collection "./tools/schematics/collection.json" cannot be resolved.
    at NodeModulesEngineHost._resolveCollectionPath (C:\Users\User\source\collecion-path\node_modules\@angular-devkit\schematics\tools\node-module-engine-host.js:91:15)
    at NodeModulesEngineHost.createCollectionDescription (C:\Users\User\source\collecion-path\node_modules\@angular-devkit\schematics\tools\file-system-engine-host-base.js:115:27)
    at SchematicEngine._createCollectionDescription (C:\Users\User\source\collecion-path\node_modules\@angular-devkit\schematics\src\engine\engine.js:147:40)
    at SchematicEngine.createCollection (C:\Users\User\source\collecion-path\node_modules\@angular-devkit\schematics\src\engine\engine.js:140:43)
    at GenerateCommand.getCollection (C:\Users\User\source\collecion-path\node_modules\@angular\cli\models\schematic-command.js:130:35)
    at GenerateCommand.initialize (C:\Users\User\source\collecion-path\node_modules\@angular\cli\commands\generate-impl.js:20:33)
    at process._tickCallback (internal/process/next_tick.js:68:7)
    at Function.Module.runMain (internal/modules/cjs/loader.js:832:11)
    at startup (internal/bootstrap/node.js:283:19)
    at bootstrapNodeJSCore (internal/bootstrap/node.js:622:3)

🌍 Your Environment

minimal repo project


Angular CLI: 8.0.0
Node: 10.16.0
OS: win32 x64
Angular: undefined
...

Package                      Version
------------------------------------------------------
@angular-devkit/architect    0.800.0
@angular-devkit/core         8.0.0
@angular-devkit/schematics   8.0.0
@angular/cli                 8.0.0
@schematics/angular          8.0.0
@schematics/update           0.800.0
rxjs                         6.4.0
typescript                   3.4.5

closed source project I found the issues on


Angular CLI: 8.0.3
Node: 10.16.0
OS: win32 x64
Angular: 8.0.2
... animations, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router

Package                            Version
------------------------------------------------------------
@angular-devkit/architect          0.800.3
@angular-devkit/build-angular      0.800.3
@angular-devkit/build-ng-packagr   0.800.3
@angular-devkit/build-optimizer    0.800.3
@angular-devkit/build-webpack      0.800.3
@angular-devkit/core               8.0.3
@angular-devkit/schematics         8.0.3
@angular/cdk                       8.0.1
@angular/cli                       8.0.3
@angular/flex-layout               8.0.0-beta.26
@angular/http                      7.2.12
@angular/material                  8.0.1
@ngtools/json-schema               1.1.0
@ngtools/webpack                   8.0.3
@schematics/angular                8.0.3
@schematics/update                 0.800.3
ng-packagr                         5.3.0
rxjs                               6.4.0
typescript                         3.4.5
webpack                            4.30.0
@alan-agius4 alan-agius4 added area: @angular-devkit/schematics freq1: low Only reported by a handful of users who observe it rarely severity3: broken type: bug/fix labels Jul 8, 2019
@ngbot ngbot bot added this to the Backlog milestone Jul 8, 2019
@alan-agius4
Copy link
Collaborator

Thanks for reporting this issue. This issue is now obsolete due to changes in the recent releases. Please update to the most recent Angular CLI version.

If the problem persists after upgrading, please open a new issue, provide a simple repository reproducing the problem, and describe the difference between the expected and current behavior.

@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 Jun 25, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area: @angular-devkit/schematics freq1: low Only reported by a handful of users who observe it rarely severity3: broken type: bug/fix
Projects
None yet
Development

No branches or pull requests

2 participants