簡體   English   中英

Spartacus CMS組件的延遲加載使應用程序在SSR模式下閃爍

[英]Spartacus Lazy loading of CMS components makes application flickers in SSR mode

我嘗試延遲加載 CMS 組件,但出現以下錯誤:

ERROR 錯誤:找不到 pipe 'async'!

它適用於 CSR,但不適用於 SSR。

我的應用程序中有Spartacus 3.4Angular 10.2.3

我在這里嘗試了 Jerry 給出的修復, https://stackoverflow.com/a/68403755/1606761

以上修復導致 SSR 出現閃爍問題。

下面是我的代碼示例,

import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { CustomProductListGuard } from './custom-product-list.guard';

@NgModule({
  imports: [
    CommonModule,
    ConfigModule.withConfig(<CmsConfig>{
      cmsComponents: {
        CMSProductListComponent: {
          component: () => import('./container/custom-product-list.component').then(m => m.CustomProductListComponent),
          guards: [CustomProductListGuard]
        }
      },
    }),
  ]
})
export class CustomProductListModule {
}

請幫我解決這個問題。

謝謝..

以前出現過用戶登錄時 SSR 閃爍的問題。 您是否嘗試過啟用傳輸 state?

以下是一些更深入的建議: https://stackoverflow.com/a/65883085/12566149

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM