Angular 7生产构建失败

时间:2018-11-29 08:05:13

标签: angular angular7 angular-service-worker ng-zorro-antd

我创建了一个angular 7项目。在我的项目中添加了Ng-zorro。使用ng serve开发时,一切工作正常。我使用以下命令添加了serviceworker:

ng add @angular/pwa

在我的tsconfig文件中,添加了以下行:

"angularCompilerOptions": {
  "enableIvy": true
} 

使用ng serve或npm start时一切正常。但是当我尝试ng build --prod时,会出现以下错误:

ERROR in : Template parse errors:
The pipe 'nzI18n' could not be found ("down-menu-item ant-select-dropdown-menu-item-disabled">
    {{ nzNotFoundContent ? nzNotFoundContent[ERROR ->] : ('Select.notFoundContent' | nzI18n) }}
  </li>
  <li
"): /Volumes/Zotac 120GB/6sense/Projects/ngx-boilerplate/node_modules/ng-zorro-antd/ng-zorro-antd.d.ts.ɵbo.html@11:44
The pipe 'nzFilterOptionPipe' could not be found ("
    [nzMode]="nzMode"
    [compareWith]="compareWith"
    *ngFor="let op[ERROR ->]tion of listOfNzOptionComponent | nzFilterOptionPipe : nzSearchValue : nzFilterOption : nzServerSearc"): /Volumes/Zotac 120GB/6sense/Projects/ngx-boilerplate/node_modules/ng-zorro-antd/ng-zorro-antd.d.ts.ɵbo.html@24:18
The pipe 'nzSubFilterOptionPipe' could not be found ("
  </li>
  <li
    *ngFor="let g[ERROR ->]roup of listOfNzOptionGroupComponent | nzSubFilterOptionPipe : nzSearchValue : nzFilterOption : nzSer"): /Volumes/Zotac 120GB/6sense/Projects/ngx-boilerplate/node_modules/ng-zorro-antd/ng-zorro-antd.d.ts.ɵbo.html@31:17
The pipe 'nzFilterOptionPipe' could not be found ("
        [nzMode]="nzMode"
        [compareWith]="compareWith"
        *ngFor="let op[ERROR ->]tion of group.listOfNzOptionComponent | nzFilterOptionPipe : nzSearchValue : nzFilterOption : nzServe"): /Volumes/Zotac 120GB/6sense/Projects/ngx-boilerplate/node_modules/ng-zorro-antd/ng-zorro-antd.d.ts.ɵbo.html@46:22
The pipe 'nzFilterOptionPipe' could not be found ("
    [nzMode]="nzMode"
    [compareWith]="compareWith"
    *ngFor="let op[ERROR ->]tion of listOfTagOption | nzFilterOptionPipe : nzSearchValue : nzFilterOption : nzServerSearch "
    "): /Volumes/Zotac 120GB/6sense/Projects/ngx-boilerplate/node_modules/ng-zorro-antd/ng-zorro-antd.d.ts.ɵbo.html@59:18

1 个答案:

答案 0 :(得分:0)

这是lib版本的问题,请尝试将您的库降级