0

I am using Compodoc for generating documentation for angular app, url: https://github.com/compodoc/compodoc

While generating a doc, i got an error. On that time, the script is accessing app-routing.module.ts file.

[18:06:24] parsing        : ../src/app/app-routing.module.ts
[18:06:24] Analysing routes definitions and clean them if necessary
Unhandled Rejection at: Promise {
<rejected> Error: Could not find the node's symbol.

This is my app-routing.module.ts

import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { AuthRestrictGuard, AuthGuard, AppUserLoadedGuard, RoleGuard } 
from '@project-core/auth';

const routes: Routes = [
{
    path: '',
    loadChildren: () => 
import('./public/landing/landing.module').then(module => 
module.LandingModule),
    canActivate: [AuthRestrictGuard]
},
{
    path: 'jumping-page',
    loadChildren: () => import('@project-business/core/project-jumping- 
page/project-jumping-page.module')
        .then(module => module.ProjectJumpingPageModule),
    canActivate: [AuthGuard, AppUserLoadedGuard, RoleGuard],
    data: {
        roles: [RolesEnum.Admin, RolesEnum.MemberAdmin, 
RolesEnum.MemberUser]
    }
},
{
    path: 'profile',
    loadChildren: () => import('@project-business/core/project- 
profile/project-profile.module')
        .then(module => module.ProjectProfileModule),
    canActivate: [AuthGuard, AppUserLoadedGuard]
},
{
    path: 'errors',
    loadChildren: () => import('./core/errors/errors.module').then(module 
=> module.ErrorsModule)
},
{
    path: '**',
    redirectTo: 'errors',
    pathMatch: 'full'
},
];

@NgModule({
imports: [RouterModule.forRoot(routes)],
exports: [RouterModule]
})
export class AppRoutingModule { }

Any luck?

Ayon Alfaz
  • 96
  • 1
  • 6

2 Answers2

0

there is ts dependency bug about this. Avoiding Routes type definition might be a workaround on this until it will be resolved

cagcak
  • 3,894
  • 2
  • 21
  • 22
0

We are already using the import(...).then(...) Promise. And the issue occurred.

{
    path: '/test',
    loadChildren: () => import('./routes/test').then(mod => mod.TestModule),
    ...
},

Compodoc: 1.1.11 TypeScript version used by Compodoc : 2.9.1 TypeScript version of current project : 4.1.5 Node.js version : v14.15.3 HINT: It works with --disableRoutesGraph flag

Salahuddin Ahmed
  • 4,854
  • 4
  • 14
  • 35