Error: Multiple root routing modules found
See original GitHub issueI’m still getting an error while adding lazy loaded routes to my Angular project. According to #87 and #82 the error should be fixed, but it isn’t.
Error:
UnhandledPromiseRejectionWarning: Error: Multiple root routing modules found C:\Users\Toni\Source\test\universe\src\app\lazy\lazy-routing.module.ts, C:\Users\Toni\Source\test\universe\src\app\app-routing.module.ts
at findRootModule (C:\Users\Toni\Source\test\universe\node_modules\guess-parser\dist\guess-parser\index.js:419:15)
at exports.parseRoutes (C:\Users\Toni\Source\test\universe\node_modules\guess-parser\dist\guess-parser\index.js:582:31)
at prerender (C:\Users\Toni\Source\test\universe\node_modules\angular-prerender\build\node\functions\prerender.js:89:54)
I’m using the following commands to create the project:
ng new universe --routing
cd universe
ng generate universal --client-project universe
ng generate module lazy --route lazy --module app
ng build
ng run universe:server
npx angular-prerender
My environment is:
- Angular CLI: 8.3.14
- Node: 12.12.0
- OS: win32 x64
- Angular: 8.2.12
And the version of angular-prerender that is being used is 4.1.21.
Is there a workaround or different syntax for adding lazy loaded routes/modules to the project? Are lazy loaded routes actually supported?
Issue Analytics
- State:
- Created 4 years ago
- Comments:9 (5 by maintainers)
Top Results From Across the Web
Multiple root routing modules found · Issue #265 · scullyio/scully
This means that the root of your application will be you normal angular app, and is not rendered by Scully In some circumstances...
Read more >Routes not found in angular routing with multiple child modules
I have a parent module and a number of child modules. Parent module routing works but none of the child routes work: Error:...
Read more >scullyio/community - Gitter
@SanderElias now I get Error: Multiple root routing modules. Preston Lamb. @pjlamb12 ... A complete log of this run can be found in:...
Read more >Add navigation with routing - Angular
First, the app-routing.module.ts file imports RouterModule and Routes so the application can have routing capability. The next import, HeroesComponent , gives ...
Read more >Routing - Remix
Because a Route module maps to only a segment of the URL, multiple routes can be ... We've found that in almost every...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’ve tested it and it works! 🔥
Hi @tonivrbic, can you please give v4.1.22 a try? I contains the fix.