Topic: Error from SlideComponent when packaging using ng-packagr
GianPiero Bresolin free asked 6 years ago
Hi guys, when I try to package up my module using ng-packagr, I get the following error from the compiler:
Start your code hereBUILD ERROR (1,1): : Directive ɵd1, Expected 0 arguments, but got 1. (1,1): : Directive ɵe1, Property 'carousel' is protected and only accessible within class 'SlideComponent' and its subclasses. (1,1): : Directive CarouselComponent, Expected 0 arguments, but got 1. Error: (1,1): : Directive ɵd1, Expected 0 arguments, but got 1. (1,1): : Directive ɵe1, Property 'carousel' is protected and only accessible within class 'SlideComponent' and its subclasses. (1,1): : Directive CarouselComponent, Expected 0 arguments, but got 1. The strange thing is that I am not using the SlideComponent/CarouselComponent anywhere in my application. In fact these errors only started appearing when I used the mdbChartdirective on a canvas element for a bar chart. Here is the module for my exported module:
Start your code here@NgModule({ imports: [ CommonModule, UiModuleWrapper, UtilitiesModule, MDBBootstrapModule.forRoot(), ToastrModule.forRoot() ], schemas: [ NO_ERRORS_SCHEMA, CUSTOM_ELEMENTS_SCHEMA ], declarations: [ CustomComponents ], exports: [ CustomComponents ] }) export class CustomUIModule { } I am importing this CustomUIModule into my app's app.module.ts, and it does run as expected, it's just not packaging correctly. Do you guys have any suggestions as to what might be wrong? Kind regards GianPiero
FREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Status
Opened
Specification of the issue
- ForumUser: Free
- Premium support: No
- Technology: MDB Angular
- MDB Version: -
- Device: -
- Browser: -
- OS: -
- Provided sample code: Yes
- Provided link: No
Tags
GianPiero Bresolin free commented 6 years ago
So I have stripped out all of my code that refers to any MDB Component or directive, and I have been manually adding each piece of code back in. The error seems to occur, when I add my MDBBootstrapModule.forRoot() (or any MDB module e.g. ChartsModule,ModalModule,WavesModule) entry into the imports statement for the CustomUIModule that I am wanting to package. Do you have any thoughts of why this might be occurring?GianPiero Bresolin free commented 6 years ago
By the way, here is the command I am using to package up my CustomUIModule: ng build --prod && ng-packagr -p package.json the ng build line passes, but fails on the second ng-packagr line? But the issue is definitely related to MDBBoostrap as it only fails when modules from MDBBootstrap are imported.