Regression: unable to resolve schematics via package name #17085
Labels
area: @angular-devkit/schematics
freq1: low
Only reported by a handful of users who observe it rarely
severity5: regression
type: bug/fix
Milestone
Uh oh!
There was an error while loading. Please reload this page.
🐞 Bug report
Command (mark with an
x
)Is this a regression?
Yes, it used to work in Angular <= 8.x
Description
I have a library "@mycompany/mylib" and a separate package containing its schematics called "@mycompany/mylib-schematics".
I used to have this entry in the library's
package.json
file:And this worked fine.
When executing, for example
ng generate @mycompany/mylib:foo
it would correctly resolve the collection.json file residing in "node_modules/@mycompany/mylib-schematics" and execute the schematic.With Angular 9 this does not work anymore. I can no longer specify a package name in the "schematics" property of the package.json file. The path specified there is always resolved relative to the package.json location. I can make it work again if I change it to this:
The problem is within
packages/angular_devkit/schematics/tools/node-module-engine-host.ts
:🔬 Minimal Reproduction
As described above, create a library and add a "collections" property to its package.json that points to another node_module, then try to "ng generate".
package.json
of "@mycompany/mylib":ng generate @mycompany/mylib:foo
:🔥 Exception or Error
🌍 Your Environment
The text was updated successfully, but these errors were encountered: