angular 开发环境本地不报错 yarn 编译部署报错

clipboard.png

这个提示真的让我有点找不到头绪 build-package下的路由打不开

clipboard.png
app.route.ts

import { BuildPackageRoute } from './build-package/build-package.route';
import { PackageRoute } from './package/package.route';
import { UserRoute } from './user/user.route';


export const AppRoute = [
  { path: '', pathMatch: 'full', redirectTo: 'build-package' },
  BuildPackageRoute,
  PackageRoute,
  UserRoute,
];

app.module.ts

import { NgModule } from '@angular/core';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { RouterModule } from '@angular/router';
import { PipesModule } from "@/pipe/pipe.module";

import { ComponentsModule } from '@/components/components.module';
import { LayoutsModule } from '@/layouts/layouts.module';
import { ApiService } from '@/services/api.service';
import { UtilService } from '@/services/util.service';
import { AppComponent } from './app.component';
import { AppRoute } from './app.route';

@NgModule({
  bootstrap: [
    AppComponent,
  ],
  declarations: [
    AppComponent,
  ],
  imports: [
    PipesModule,
    BrowserAnimationsModule,
    ComponentsModule,
    LayoutsModule,
    RouterModule.forRoot(AppRoute, { onSameUrlNavigation: 'reload' }),
  ],
  providers: [
    ApiService,
    UtilService,
  ],
})
export class AppModule { }

build-paclage.route.ts

export const BuildPackageRoute = {
  path: 'build-package',
  data: { name: '装箱扫描' },
  children: [
    { path: '', pathMatch: 'full', redirectTo: 'add' },
    { path: 'add', data: { name: '添加' }, loadChildren: '@/app/build-package/add/add.module#AddModule' },
  ],
};

有大神帮忙看看么

阅读 2.5k
1 个回答

解决了 但是还是不太清楚原因 之前app.module.ts中引用了一些没用到的pipe等其他的模块 后来删除了 重新安装依赖 编译 就可以了

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题
宣传栏