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

It doesn't work with SSR #10

Open
monti-cistella opened this issue Jan 28, 2021 · 2 comments
Open

It doesn't work with SSR #10

monti-cistella opened this issue Jan 28, 2021 · 2 comments
Labels
help wanted Extra attention is needed

Comments

@monti-cistella
Copy link

If you import this module and compile with Angular Universal Server Side Rendering, then the project does not work, the website does not charge in the browser.

@monti-cistella
Copy link
Author

SOLVED!

The problem comes from the startTimer function of the carousel.component.ts. The timer blocks the Server App. It seems that the filter(() => this.isVisible() in the pipe is not enough. I just added a condition if isPlatformBrowser before this times and now it works perfectly:

if (isPlatformBrowser(this.platformId)) {
this.timer$
.pipe(
takeUntil(this.timerStop$),
takeUntil(this.destroy$),
filter(() => this.isVisible())
)
.subscribe(() => {
this.listKeyManager.withWrap(true).setNextItemActive();
this.listKeyManager.withWrap(this.loop);
});
}

If you have the same problem, just apply this solution. In my case I'm using Angular 10.2.3 and Universal 10.1.

@gabrielbusarello gabrielbusarello added the help wanted Extra attention is needed label Feb 11, 2021
@sagrawal31
Copy link

We are also having the same problem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants