angular - Promise 未处理的拒绝 | 康波多克 | 角
问题描述
我正在使用 Compodoc 为 Angular 应用程序生成文档,网址: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 { }
运气好的话?
解决方案
我们已经在使用import(...).then(...)
Promise。问题发生了。
{
path: '/test',
loadChildren: () => import('./routes/test').then(mod => mod.TestModule),
...
},
Compodoc:Compodoc 使用的 1.1.11 TypeScript 版本:当前项目的 2.9.1 TypeScript 版本:4.1.5 Node.js 版本:v14.15.3 提示:它与 --disableRoutesGraph 标志一起使用
推荐阅读
- r - 有没有办法在 R 中的数据表的两列中查找公共项?
- python - Python中的跳转打印
- javascript - 我想打开我的页面语言特定的 NextJs
- r - 当 FOR 循环包含 seq 时,foreach 不起作用
- r - 如何在 R 中使用 ggplot 增加哑铃图的间隙间隔
- excel - 如何解决使用 excel QM 时出现的错误 424?
- regex - 正则表达式 - 破折号匹配
- sql - 如何对多列中的一列中的数据进行排序oracle sql
- html - 如果弹出窗口中的数据过多,则不会出现下面的数据。我想做一个降序结构。我该怎么做?
- python - 如何在给定一对日期的情况下提取一系列年份并生成新行