[BUG] Lazy loaded routes are not documented
See original GitHub issueOverview of the issue
Lazy Loaded routes are not showing in documentation:
Operating System, Node.js, npm, compodoc version(s)
OS: Windows Node: 12.8.0 npm: 6.10.2 Angular CLI: 9.1.0
Compodoc installed globally or locally ?
Tried both
If possible sourcecode of the file where it breaks
Here is part of my app-routing.module.ts
// src/app/app-routing.module.ts
const routes: Routes = [
{
path: 'module1',
loadChildren: () =>
import('./modules/module1/module1.module').then((m) => m.Module1Module),
}
]
And for each module, such as Module1
:
// src/app/modules/module1/module1-routing.module.ts
const routes: Routes = [
{
path: '',
component: Module1Component,
data: {
...
},
canActivate: [AuthGuard],
children: [
{
path: '',
redirectTo: 'list'
},
{
path: 'list',
pathMatch: 'full',
component: ListComponent,
data: {
...
},
},
{
path: ':id',
component: DetailsComponent,
data: {
...
},
},
],
},
];
If possible your terminal logs before the error
Error during generation of routes JSON file, maybe a trailing comma or an external variable inside one route.
Motivation for or Use Case
It should document all routes in the corresponding section.
Reproduce the error
- Create a new app using the CLI and adding
--routing
- Create a new module (
ng g m module --routing
) - Add some routes an sample components as previously specified.
- Try to create the documentation (
npx compodoc -p tsconfig.json
)
Related issues
Several times, but all of them have been closed due to inactivity #690, #569, #609, #805, #819.
Suggest a Fix
I haven’t found a solution yet.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:8
- Comments:19
Top Results From Across the Web
Route - Angular
A configuration object that defines a single route. A set of routes are collected in a Routes array to define a Router configuration....
Read more >multiple routes are not working in angular 10 lazy loaded ...
I want to have multiple routes there on the productModule but it is not working. Can anyone help? I have tried cannot find...
Read more >Resolving errors faced while implementing Lazy Loading with ...
It is a known bug in Angular that lazy loading module does not work well with Auxiliary routes / named router. For a...
Read more >Code-Splitting - React
Code-splitting your app can help you “lazy-load” just the things that are ... that Babel can parse the dynamic import syntax but is...
Read more >Lazy load Angular Components | juri.dev
For the routing, the Angular CLI makes sure to create that bundle whenever it sees a loadChildren and according path. For our own...
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
Hi, I’ve just found a workaround that works for me on compodoc 1.1.11. Just replace
(m) => m.MyModule
by
m => m.MyModule
I think the regex need some improvement here : https://github.com/compodoc/compodoc/blob/8c509f0c130fb7cfc63f470a16e2fce73ddca092/src/utils/router-parser.util.ts#L25
The issue still exists.