将现有项目导入到我的IDE(webstorm)中并安装依赖项后,我运行ionic serve并成功编译。即使该页面无法加载。
在浏览器中,我收到以下消息:“网页正在使您的浏览器变慢。您想做什么?” 我单击“停止”按钮,并使用开发人员工具在控制台中收到此警告:
Error: Script terminated by timeout at:
getInjectableDef@http://localhost:8100/vendor.js:34163:5
resolveNgModuleDep@http://localhost:8100/vendor.js:55246:35
./node_modules/@angular/core/fesm5/core.js/NgModuleRef_.prototype.get@http://localhost:8100/vendor.js:55950:16
resolveNgModuleDep@http://localhost:8100/vendor.js:55261:29
./node_modules/@angular/core/fesm5/core.js/NgModuleRef_.prototype.get@http://localhost:8100/vendor.js:55950:16
resolveNgModuleDep@http://localhost:8100/vendor.js:55261:29
./node_modules/@angular/core/fesm5/core.js/NgModuleRef_.prototype.get@http://localhost:8100/vendor.js:55950:16
resolveNgModuleDep@http://localhost:8100/vendor.js:55261:29
./node_modules/@angular/core/fesm5/core.js/NgModuleRef_.prototype.get@http://localhost:8100/vendor.js:55950:16
resolveNgModuleDep@http://localhost:8100/vendor.js:55261:29
./node_modules/@angular/core/fesm5/core.js/NgModuleRef_.prototype.get@http://localhost:8100/vendor.js:55950:16
resolveNgModuleDep@http://localhost:8100/vendor.…
更新:
由于延迟加载功能的错误实施而导致的问题。
让我们假设A是一个组件,而B和C是子组件
错误的实现:
{
{
path: '',
loadChildren: './a.module#aPageModule',
},
{
path: 'b',
loadChildren: './b/b.module#bPageModule'
},
{
path: 'c',
loadChildren: './c/c.module#cPageModule'
}
}
正确的实现:
{
{
path: '',
loadChildren: './a.module#aPageModule',
children: [
{
path: 'b',
loadChildren: './b/b.module#bPageModule'
},
{
path: 'c',
loadChildren: './c/c.module#cPageModule'
}
]
}
}