-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Angular v9 & ngx-bootstrap v6.0.0: Failed to load #5862
Comments
Well, I've never seen such issues before. |
I am seeing a similar error when running our unit tests with Angular 10.0.2, ngx-bootstrap 6.0.0, Bootstrap 3.4.1:
Unfortunately I think our app is too big and complex to come up with some sort of StackBlitz at this time. Might be worth noting we use ng-bullet for most of our test suite, but I get errors without it too. I tried wrapping with fakeAsync, from:
to:
and got a new error: |
I have the same problem that @jziggas! The project that I'm working is too complex and private. |
I get something like @jziggas in my Storybook with
|
The browser was looking for popover-container.component.html here: which is obviously wrong. |
It works with the exact same setup and ngx-bootstrap @ 5.6.1 |
I have the same errors in the test of an Angular 10 (ivy disabled). If I enable ivy, everything runs fine 😄 🎉 Here my setup, if that helps.
With Angular 10 I have to ensure all the component templates are compiled before using them in the tests (See line 4 below). It seems that loading the modules like this fails: beforeEach(async(() => TestBed.configureTestingModule({
imports: [BsDatepickerModule.forRoot(), ReactiveFormsModule],
declarations: [TestComponent, TranslatePipeMock]
}).compileComponents()
));
beforeEach(() => {
fixture = TestBed.createComponent(TestComponent);
component = fixture.componentInstance;
component.ngOnChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
}); Karma / Jasmine error:
|
I think this should be urgent, It really prevents a lot of projects to be updated to Angular 10, |
Shipping as Ivy compiled is not recommended by Angular it it breaks every library that has a dependency on ngx-bootstrap and that does not ship as Ivy compiled. Enabling "fullTemplateTypeCheck" also works around an Angular compiler problem regarding the `forRoot()` not working.. See valor-software#5862
So the reason is that the library is shipped as Ivy-compiled. The root cause is not a change in ngx-bootstrap but a change in defaults either in ng-packagr or Angular compiler. The referenced PR fixes thing for me in library builds and also I no longer have to enable Ivy for the tests |
Awesome, thanks for the insight @dr-itz ! |
Shipping as Ivy compiled is not recommended by Angular it it breaks every library that has a dependency on ngx-bootstrap and that does not ship as Ivy compiled. Enabling "fullTemplateTypeCheck" also works around an Angular compiler problem regarding the `forRoot()` not working.. See #5862
|
is available in npm, but not marked as latest yet |
Bug description:
When I upgrade to v6.0.0 version with Angular v9.1.9 Library project, I've been thrown with the below error:
Versions of ngx-bootstrap, Angular, and Bootstrap:
ngx-bootstrap: v6.0.0
Angular: v9.1.9
Bootstrap: 4.4.1
Build system: Angular CLI, System.js, webpack, starter seed: Angular CLI
Expected behavior
Build should happen without problems
NOTE: I followed some examples of implementation of version 6 (with version 5.5 this did not happen), do you have any idea what is happening and how to solve it?
The text was updated successfully, but these errors were encountered: