Utilizing ng-toolkit in conjunction with ng add @ng-toolkit/universal
proved to successfully integrate Angular Universal support into my project.
After building the production version without encountering any errors and running the server seamlessly, I faced an issue where the server would not respond when a request was made (nodeJS failed to render any output).
Upon investigation, it was revealed that one of my components was causing this breakdown in server-side rendering. The culprit turned out to be the Mat-Carousel:
component:
export class BannerComponent {
slides: any[] = [
// tslint:disable-next-line:max-line-length
{ image: 'assets/banner/banner-one.png' },
// tslint:disable-next-line:max-line-length
{ image: 'assets/banner/banner-two.png' },
// tslint:disable-next-line:max-line-length
{ image: 'assets/banner/banner-three.png' }
];
}
template:
<section class="sec-space-b" id="banner">
<mat-carousel
timings="250ms ease-in"
[autoplay]="true"
interval="5000"
color="accent"
maxWidth="auto"
proportion="25"
slides="5"
[loop]="true"
[hideArrows]="false"
[hideIndicators]="false"
[useKeyboard]="true"
[useMouseWheel]="false"
orientation="ltr"
>
<mat-carousel-slide
#matCarouselSlide
*ngFor="let slide of slides; let i = index"
overlayColor="#00000000"
[image]="slide.image"
[hideOverlay]="false"
></mat-carousel-slide>
</mat-carousel>
</section>
Is there a way to resolve this issue? Can I exclude a specific component from the Server-Side build in some manner?