From 7fa881919befd074f0f233516f030b10af649642 Mon Sep 17 00:00:00 2001 From: Brandon Winchester Date: Wed, 12 Feb 2020 09:54:32 -0600 Subject: [PATCH] docs: Add documentation about the CLI failing (#35385) The CLI seems to throw very non-descriptive errors. Adding a section to help users troubleshoot lazy-loading modules. PR Close #35385 --- aio/content/guide/lazy-loading-ngmodules.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/aio/content/guide/lazy-loading-ngmodules.md b/aio/content/guide/lazy-loading-ngmodules.md index 7c3e41d8b5..367c14a102 100644 --- a/aio/content/guide/lazy-loading-ngmodules.md +++ b/aio/content/guide/lazy-loading-ngmodules.md @@ -322,6 +322,13 @@ ngOnInit() { For more information with a working example, see the [routing tutorial section on preloading](guide/router-tutorial-toh#preloading-background-loading-of-feature-areas). +## Troubleshooting lazy-loading modules + +A common error when lazy-loading modules is importing common modules in multiple places within an application. You can test for this condition by first generating the module using the Angular CLI and including the `--route route-name` parameter, where `route-name` is the name of your module. Next, generate the module without the `--route` parameter. If the Angular CLI generates an error when you use the `--route` parameter, but runs correctly without it, you may have imported the same module in multiple places. + +Remember, many common Angular modules should be imported at the base of your application. + +For more information on Angular Modules, see [NgModules](guide/ngmodules). ## More on NgModules and routing