I have an angular 8 library lib-a with the child components child-x and child-y.
while consuming the lib-a in angular 9 project getting build error as below:
**ERROR in The target entry-point "@abc/lib-a" has missing dependencies:
And the ng-package.json is,
{
"$schema": "../../node_modules/ng-package/ng-package.schema.json",
"dest": "../../dist/lib-a",
"lib": {
"entryFile": "src/public-api.ts"
}
}
and the package.json of lib-a is:
{
"name": "lib-a",
"version": "1.0.6",
"description": "lib a",
"peerDependencies": {
"@angular/common": "^8.0.0",
"@angular/core": "^8.0.0",
"@angular/elements": "^9.1.6",
"@angular/cdk": "^8.2.3"
}
}
Edit: public-api.ts
export * from './lib-a/lib-a.module';
export * from './lib-a/child-x/child-x.component';
export * from './lib-a/child-y/child-y.component';
I tried fixing by adding the components in public-api.ts entry point, but that is not working.
I searched the web but no answers for question-related to this child component.
This problem popped up for me and I was able to solve it. I have an angular library and application within my projects folder. I was playing around with using imports that refrenced the library as opposed to the absolute path of components, ie import {mycomponent} from 'my-library' instead of import {mycomponent} from 'projects/src/lib/<etc>'. Code was lingering that pointed to the dist folder. Once I deleted the dist folder, the real errors showed (these references). Once I fixed these errors the problem was fixed.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With