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.
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.