我正在使用Compodoc为angular应用程序生成文档,url:https://github.com/compodoc/compodoc
生成文档时,我遇到错误。此时,脚本正在访问app-routing.module.ts文件。
[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.这是我的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 { }有什么发现吗?
发布于 2021-04-21 15:58:45
关于这一点存在ts依赖错误。在解决此问题之前,避免路径类型定义可能是一种解决方法
发布于 2021-06-15 14:36:37
我们已经在使用import(...).then(...) Promise。问题就出现了。
{
path: '/test',
loadChildren: () => import('./routes/test').then(mod => mod.TestModule),
...
},Compodoc: 1.1.11 Compodoc使用的TypeScript版本: 2.9.1当前项目的TypeScript版本: 4.1.5 Node.js版本: v14.15.3提示:它使用--disableRoutesGraph标志
https://stackoverflow.com/questions/59646128
复制相似问题