RangeError: Maximum call stack size exceeded Lazy routing Angular 2

后端 未结 7 870
礼貌的吻别
礼貌的吻别 2020-12-13 23:38

I\'m trying to implement lazy routing into my app.

I have a very big project and when it was at router-deprecated I used AsyncRoute, but now it was removed.

7条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-14 00:21

    Above answers are good. Check out your imports - probably you forgot to import module. You can also check your typescript package version. In my case in Angular 5, I had a warning in CLI:

    @angular/compiler-cli@5.2.11 requires typescript@'>=2.4.2 <2.5.0' but 2.5.3 was found instead. Using this version can result in undefined behaviour and difficult to debug problems. Please run the following command to install a compatible version of TypeScript.

    npm install typescript@'>=2.4.2 <2.5.0' --save
    

    This can also make errors.

提交回复
热议问题