valor-software / ngx-bootstrap

Fast and reliable Bootstrap widgets in Angular (supports Ivy engine)
https://valor-software.com/ngx-bootstrap
MIT License
5.53k stars 1.69k forks source link

Angular 9.1.0 ngcc error NG1010: Expected array when reading the NgModule.declarations of BsDatepickerModule #5731

Closed Exocomp closed 4 years ago

Exocomp commented 4 years ago

Angular (latest v9.1.0) ngx-bootstrap (latest v 5.5.0)

This started when I upgraded Angular from 9.0.6 -> 9.1.0.

ngcc throws the following error

Error: Failed to compile entry-point ngx-bootstrap/datepicker (esm5 as esm5) due to compilation errors:
node_modules/ngx-bootstrap/datepicker/esm5/bs-datepicker.module.js:79:35 - error NG1010: Expected array when reading the NgModule.declarations of BsDatepickerModule

 79                     declarations: tslib_1.__spread([
                                      ~~~~~~~~~~~~~~~~~~
 80                         BsCalendarLayoutComponent,
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
...
 88                         BsYearsCalendarViewComponent
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 89                     ], _exports),
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
daniloff200 commented 4 years ago

Hello, @Exocomp

Version 5.5.0 doesn't support NG9 at all, and we had bunch of issues with that 5.6.0 should handle it.

Can you try to update to 5.6.0?

Also, it will be very cool, if you provide some demo via Stackblitz

Exocomp commented 4 years ago

@daniloff200 I tried 5.6.0 but I can still reproduce it with my project.

I'll try to reproduce it with a new project.

Exocomp commented 4 years ago

@daniloff200

This is a new angular project with ngx-bootstrap:

82antu commented 4 years ago

Hi,

seems that, according to https://github.com/angular/angular/pull/34661

"libraries using spread in object literals cannot be processed".

I suppose this is the case of BsDatepickerModule, where spread syntax is used

daniloff200 commented 4 years ago

yeah, I also saw that right now, and tried to remove the spread from there, and ngcc compilation was successful Gonna create a PR today with a fix

shayaneumar-mitel commented 4 years ago

@daniloff200 I also faced the same issue while upgrading our application to angular 9. Looks like the fix is already merged, when can expect this changes to be published?

daniloff200 commented 4 years ago

We need @valorkin for it :) :clap:

valorkin commented 4 years ago

It will be released before Monday

jholm117 commented 4 years ago

@valorkin I did not see it get released yet. Is there a revised timeline?

epaaj commented 4 years ago

I did not see it get released yet. Is there a revised timeline?

https://github.com/valor-software/ngx-bootstrap/releases/tag/v5.6.1