更新软件包后出错-无法获取

时间:2018-06-29 23:54:16

标签: angular

Angular 6.0.7 + .net core 2.1

[发布更新]
不知道出了什么问题,但是我已经升级到Angular 6.0.7,并且“似乎是问题开始的时候。幸运的是,我使用git,所以我恢复了更改,回到6.06,并且我还对/ node_modules做了npm安装,问题消失了。

Ived更新了一些软件包,并安装了一些其他软件包。现在,当我运行该应用程序时,它不会加载默认路由,但是我认为我没有对该应用程序的那部分进行任何更改。如何调试这种情况。以下是我的应用程序模块及其使用的路由文件。同样,在我更新一些节点模块之前,这种方法工作正常。

还请注意,在下面的代码中,我启用了路由跟踪,并且在控制台中也看不到任何内容,这使我认为它试图在路由发生之前就加载一些东西。

我在浏览器中得到的响应(页面源)

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Error</title>
</head>
<body>
<pre>Cannot GET /</pre>
</body>
</html>

代码:

import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';

import { WarehouseModule } from './warehouse/warehouse.module';
import { routing } from './app.routes';
import { AppComponent } from './app.component';

@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    BrowserModule,
    WarehouseModule,
    routing
  ],
  providers: [],
  bootstrap: [AppComponent]
})
export class AppModule { }

在app.routes.ts中

const appRoutes: Routes = [
  //{ path: 'home', component: HomeComponent },
  { path: '', component: WarehouseComponent },  
];

export const routing: ModuleWithProviders = RouterModule.forRoot(appRoutes, { enableTracing: true });

仓库模块:

import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { ButtonsModule } from '@progress/kendo-angular-buttons';

import { WarehouseComponent } from './warehouse.component';

@NgModule({
  declarations: [
    WarehouseComponent
  ],
  imports: [
    BrowserModule, BrowserAnimationsModule, ButtonsModule
  ],
  providers: []
})
export class WarehouseModule { }

0 个答案:

没有答案