1. Some issues

1.1. Production error

1.1.1. 1. e is not a constructor

ng build shows some warnings -- export something failed. When ng-zorro-antd 7.2 gets introduced into the project, @angular/cdk 6, a google material component dev kit, was used then as a dependency of ng-zorro-antd. But that cdk 6 doesn't export ScrollingModule. Although in dev environment the angular app is working well, e is not a constructor error raises in prod mode.

One way to solve this issue is to upgrade @angular/cdk to "^7.3.6".

1.1.2. 2. ERROR Error: StaticInjectorError(AppModule)[t -> Overlay]:

ERROR Error: StaticInjectorError(AppModule)[CdkConnectedOverlay -> Overlay]:
  StaticInjectorError(Platform: core)[CdkConnectedOverlay -> Overlay]:
    NullInjectorError: No provider for Overlay!

When calling ng-zorro-antd select component, you might see this error due to the missing of CdkOverlayModule.

As we know, javascript is minimized, it's hard to understand the error. To display the whole error, do below:

ng serve --prod --optimization=false

You may see this error:

ng build --prod produces FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory

So you need to increase memory limit:

export NODE_OPTIONS=--max_old_space_size=4096
Copyright © Guanghui Wang all right reserved,powered by GitbookFile Modified: 2019-08-25 13:56:34

results matching ""

    No results matching ""