Skip to content
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

SSR Error: No component factory found for NgbTypeaheadWindow. #2190

Closed
Stajor opened this issue Feb 25, 2018 · 2 comments
Closed

SSR Error: No component factory found for NgbTypeaheadWindow. #2190

Stajor opened this issue Feb 25, 2018 · 2 comments

Comments

@Stajor
Copy link

Stajor commented Feb 25, 2018

Bug description:

On SSR with universal I get an error

Error: No component factory found for NgbTypeaheadWindow. Did you add it to @NgModule.entryComponents?

App module

...
  imports: [
    NgbModule.forRoot(),
    ...
  ],
...

Lazy loading module

...
imports: [
    ...
    NgbModule
  ]
...

Template

<input class="form-control" id="search" formControlName="search" [ngbTypeahead]="search.bind(this)" />

Version of Angular, ng-bootstrap, and Bootstrap:

Angular: 5.2.6

ng-bootstrap: 1.0.0

@pkozlowski-opensource
Copy link
Member

This, most likely, happens because of this line:

this._windowFactory = componentFactoryResolver.resolveComponentFactory<T>(type);

It seems like trying to resolve a component in a constructor breaks ssr. Additional info in #2180

@EcoFreak
Copy link

Was this bug fixed?
I'm having troubles using a modal that is in a lazy loaded module.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants