Error : Multiple root routing modules found with nx workspace project
See original GitHub issueI am testing guess-parser
in my nx repo https://github.com/xmlking/yeti
I am using guess-parser
v0.4.14
var guess_parser = require("guess-parser");
var routes = [];
try {
// routes = guess_parser.parseAngularRoutes('webapp').map(r => r.path);
routes = guess_parser.parseAngularRoutes('./apps/webapp/src/app').map(r => r.path);
console.log(routes);
}
catch (e) {
console.log('error', e);
}
How to reproduce
git clone https://github.com/xmlking/yeti.git
yarn install
node node guess-parser-test.js
Getting following error for parseAngularRoutes('./apps/webapp/src/app')
node guess-parser-test.js
error TypeError: Cannot read property 'eagerRoutes' of undefined
at collectRoutingModules (/Users/schintha/Developer/Work/SPA/yeti/node_modules/guess-parser/dist/guess-parser/index.js:465:17)
at processLazyRoute (/Users/schintha/Developer/Work/SPA/yeti/node_modules/guess-parser/dist/guess-parser/index.js:463:9)
at Array.forEach (<anonymous>)
at collectRoutingModules (/Users/schintha/Developer/Work/SPA/yeti/node_modules/guess-parser/dist/guess-parser/index.js:466:28)
at Object.exports.parseRoutes [as parseAngularRoutes] (/Users/schintha/Developer/Work/SPA/yeti/node_modules/guess-parser/dist/guess-parser/index.js:598:9)
at Object.<anonymous> (/Users/schintha/Developer/Work/SPA/yeti/guess-parser-test.js:6:27)
at Module._compile (internal/modules/cjs/loader.js:1139:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1159:10)
at Module.load (internal/modules/cjs/loader.js:988:32)
at Function.Module._load (internal/modules/cjs/loader.js:896:14)
Getting following error for parseAngularRoutes('webapp')
node guess-parser-test.js
error Error: Multiple root routing modules found /Users/schintha/Developer/Work/SPA/yeti/apps/webapp/src/app/app.module.ts, /Users/schintha/Developer/Work/SPA/yeti/libs/admin/src/lib/admin.module.ts, /Users/schintha/Developer/Work/SPA/yeti/libs/blog/src/lib/blog.module.ts, /Users/schintha/Developer/Work/SPA/yeti/libs/dashboard/src/lib/dashboard.module.ts, /Users/schintha/Developer/Work/SPA/yeti/libs/home/src/lib/home.module.ts, /Users/schintha/Developer/Work/SPA/yeti/libs/not-found/src/lib/not-found.module.ts
at findRootModule (/Users/schintha/Developer/Work/SPA/yeti/node_modules/guess-parser/dist/guess-parser/index.js:434:15)
at Object.exports.parseRoutes [as parseAngularRoutes] (/Users/schintha/Developer/Work/SPA/yeti/node_modules/guess-parser/dist/guess-parser/index.js:598:31)
at Object.<anonymous> (/Users/schintha/Developer/Work/SPA/yeti/guess-parser-test.js:5:27)
at Module._compile (internal/modules/cjs/loader.js:1139:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1159:10)
at Module.load (internal/modules/cjs/loader.js:988:32)
at Function.Module._load (internal/modules/cjs/loader.js:896:14)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12)
at internal/main/run_main_module.js:17:47
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
scullyio/community - Gitter
I just pushed the ng-lib-v8 an tried it on my system, no errors. ... We did not find an empty route ({path:'', component:rootComponent})...
Read more >Error: More than one module matches. Use skip-import option ...
Show activity on this post. There are two ways to solve this issue. 1) Skip (using --skip-import in command) default import and create ......
Read more >Project Configuration - Nx
Both package.json and project.json files are located in each project's folder. Nx merges the two files to get each project's configuration.
Read more >Getting started with standalone components - Angular
Standalone components provide a simplified way to build Angular applications. Standalone components, directives, and pipes aim to streamline the authoring ...
Read more >Combining Multiple Angular Applications into a Single One
This probably looks like what you expect from an Angular project: ... Open up the app routing module and find the routes constant:...
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
@mgechev I get the same problem in Angular 9:
extend.webpack.config.js file:
The problem is that I have the following URLs in the Routings of each module
app-routing.module.ts
contact-routing.module.ts
auth-routing.module.ts
And similar routes in home, product, about and order routing modules. Repository: Platzi Store
@mgechev Just F.Y.I…
v0.4.15
causingMultiple root routing modules found
error with nx workspace projectsv0.4.14
works fine.