angular 开发环境本地不报错 yarn 编译部署报错
这个提示真的让我有点找不到头绪 build-package下的路由打不开
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' },
],
};
有大神帮忙看看么
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
解决了 但是还是不太清楚原因 之前app.module.ts中引用了一些没用到的pipe等其他的模块 后来删除了 重新安装依赖 编译 就可以了