Title: Why is Angular Lazy loading and routing not working after migrating to Angular 6 ? · Issue #19092 · angular/angular-cli · GitHub
Open Graph Title: Why is Angular Lazy loading and routing not working after migrating to Angular 6 ? · Issue #19092 · angular/angular-cli
X Title: Why is Angular Lazy loading and routing not working after migrating to Angular 6 ? · Issue #19092 · angular/angular-cli
Description: In my application , lazy loading was perfectly working in Angular 4 and 5 . However , after I migrated to Angular 6 , the lazy loading and routing has stopped working when I use ng serve. The routes for the application are defined in app...
Open Graph Description: In my application , lazy loading was perfectly working in Angular 4 and 5 . However , after I migrated to Angular 6 , the lazy loading and routing has stopped working when I use ng serve. The route...
X Description: In my application , lazy loading was perfectly working in Angular 4 and 5 . However , after I migrated to Angular 6 , the lazy loading and routing has stopped working when I use ng serve. The route...
Opengraph URL: https://github.com/angular/angular-cli/issues/19092
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Why is Angular Lazy loading and routing not working after migrating to Angular 6 ?","articleBody":"In my application , lazy loading was perfectly working in Angular 4 and 5 . However , after I migrated to Angular 6 , the lazy loading and routing has stopped working when I use ng serve.\r\n\r\nThe routes for the application are defined in `app.module.ts` like this :\r\n\r\n\t\t\t RouterModule.forRoot([\r\n\t\t\t\t { path: 'info/:gitCode/:pemCode/:getRtComponent', component: RedComponent },\r\n\t\t\t\t { path: 'info/:gitCode/:pemCode/:getFaq/:getRtComponent', component: RedComponent },\r\n\t\t\t\t { path: 'loadGuardsInfo/:gitCode/:pemCode/:getRtComponent', component: RedComponent },\r\n\t\t\t\t { path: 'loadGuardsInfo/:getRtComponent', component: RedComponent },\r\n\t\t\t\t { path: 'recDet', component: RecDetComponent },\r\n\t\t\t\t { path: 'SlaveComponent/:pfScreen', loadChildren: './ally/slave/slave.module#SlaveModule' },\r\n\t\t\t\t { path: 'MasterComponent/:pfScreen', loadChildren: './ally/master/master.module#MasterModule' },\r\n\t\t\t\t { path: 'DashedComponent/:pfScreen', loadChildren: './ally/dashed/dashed.module#DashedModule' }\r\n\t\t\t\t ])\r\n\t\t\t ],\r\n\t\t\t providers: [ReqService, { provide: APP_BASE_HREF, useValue: './' }, {\r\n\t\t\t\tprovide: ErrorHandler,\r\n\t\t\t\tuseClass: GlobalErrorHandler\r\n\t\t\t }, { provide: LocationStrategy, useClass: HashLocationStrategy }],\r\n\t\t\t bootstrap: [AppComponent],\r\n\t\t\t exports: []\r\n\r\nI have gone through a lot of articles on the internet about this and tried out a lot of things , but none worked . While migrating from angular 5 to 6, a lot of configurations in the old code got changed like : `angular-cli.json` got changed to `angular.json` . Lot of packages in `package.json` got upgraded and 2 new packages got introduced : `@angular-devkit/build-angular` and `rxjs-compat` . The package : `@angular-devkit/build-angular` seems to be utilized by the `angular.json` for build and serve . I am not understanding why the migration has broken the routing and lazy loading .\r\n\r\nCan someone please help me out here ?\r\n\r\nMy `Package.json` dependencies are listed below : \r\n\r\n\t\t\"dependencies\": {\r\n\t\t\t\"@angular/animations\": \"^6.1.10\",\r\n\t\t\t\"@angular/common\": \"^6.1.10\",\r\n\t\t\t\"@angular/compiler\": \"^6.1.10\",\r\n\t\t\t\"@angular/core\": \"^6.1.10\",\r\n\t\t\t\"@angular/forms\": \"^6.1.10\",\r\n\t\t\t\"@angular/http\": \"^6.1.10\",\r\n\t\t\t\"@angular/platform-browser\": \"^6.1.10\",\r\n\t\t\t\"@angular/platform-browser-dynamic\": \"^6.1.10\",\r\n\t\t\t\"@angular/platform-server\": \"^6.1.10\",\r\n\t\t\t\"@angular/router\": \"^6.1.10\",\r\n\t\t\t\"@ng-idle/core\": \"^6.0.0-beta.5\",\r\n\t\t\t\"@ng-idle/keepalive\": \"^6.0.0-beta.5\",\r\n\t\t\t\"ag-grid\": \"14.2.0\",\r\n\t\t\t\"ag-grid-angular\": \"14.2.0\",\r\n\t\t\t\"angular-polyfills\": \"1.0.1\",\r\n\t\t\t\"angular2-uuid\": \"1.1.1\",\r\n\t\t\t\"bootstrap\": \"3.3.7\",\r\n\t\t\t\"core-js\": \"2.5.3\",\r\n\t\t\t\"exceljs\": \"1.0.0\",\r\n\t\t\t\"file-saver\": \"1.3.3\",\r\n\t\t\t\"font-awesome\": \"4.7.0\",\r\n\t\t\t\"http-proxy\": \"1.16.2\",\r\n\t\t\t\"primeng\": \"4.3.0\",\r\n\t\t\t\"rxjs\": \"^6.6.3\",\r\n\t\t\t\"rxjs-compat\": \"^6.2.0\",\r\n\t\t\t\"ts-helpers\": \"1.1.2\",\r\n\t\t\t\"xlsx\": \"0.10.9\",\r\n\t\t\t\"zone.js\": \"^0.8.29\"\r\n\t\t },\r\n\t\t \"devDependencies\": {\r\n\t\t\t\"@angular-devkit/build-angular\": \"~0.8.0\",\r\n\t\t\t\"@angular/cli\": \"^6.2.9\",\r\n\t\t\t\"@angular/compiler-cli\": \"^6.1.10\",\r\n\t\t\t\"@types/jasmine\": \"2.8.6\",\r\n\t\t\t\"@types/node\": \"7.0.57\",\r\n\t\t\t\"@types/systemjs\": \"0.20.6\",\r\n\t\t\t\"codelyzer\": \"^6.0.0\",\r\n\t\t\t\"jasmine-core\": \"2.6.4\",\r\n\t\t\t\"jasmine-spec-reporter\": \"4.2.1\",\r\n\t\t\t\"jquery\": \"3.3.1\",\r\n\t\t\t\"jquery-ui\": \"1.12.1\",\r\n\t\t\t\"karma\": \"1.3.0\",\r\n\t\t\t\"karma-chrome-launcher\": \"2.1.1\",\r\n\t\t\t\"karma-cli\": \"1.0.1\",\r\n\t\t\t\"karma-html-reporter\": \"0.1.3\",\r\n\t\t\t\"karma-htmlfile-reporter\": \"0.3.5\",\r\n\t\t\t\"karma-jasmine\": \"1.1.1\",\r\n\t\t\t\"karma-remap-istanbul\": \"0.2.2\",\r\n\t\t\t\"karma-story-reporter\": \"0.3.1\",\r\n\t\t\t\"protractor\": \"4.0.14\",\r\n\t\t\t\"ts-node\": \"3.0.4\",\r\n\t\t\t\"tslint\": \"5.9.1\",\r\n\t\t\t\"typescript\": \"^2.7.2\"\r\n\t\t }","author":{"url":"https://github.com/kunal00731","@type":"Person","name":"kunal00731"},"datePublished":"2020-10-15T21:45:37Z","url":"https://github.com/angular/angular-cli/issues/19092"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:a7f43696-c8dc-dff9-39b8-b558ed5f2729 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | EB16:DB09F:13154E2:185C90D:6B0127DA |
| html-safe-nonce | bde4dd0ce8d2f5c6d897333da27bfe7e86c7000bbe594e23fd444ae8253f1130 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFQjE2OkRCMDlGOjEzMTU0RTI6MTg1QzkwRDo2QjAxMjdEQSIsInZpc2l0b3JfaWQiOiI1ODA0NjcxNDQzNjIzMDI4Njk4IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | a6cbef7acc28b66604c031ed8c7c3f38de714a354bad6245db54b009d33d8184 |
| hovercard-subject-tag | issue:722696878 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/angular/angular-cli/19092/issue_layout |
| twitter:image | https://opengraph.githubassets.com/265ed0a6c04d900f656234a3686dafc1ca15904ad085fa52406aa076044d8f78/angular/angular-cli/issues/19092 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/265ed0a6c04d900f656234a3686dafc1ca15904ad085fa52406aa076044d8f78/angular/angular-cli/issues/19092 |
| og:image:alt | In my application , lazy loading was perfectly working in Angular 4 and 5 . However , after I migrated to Angular 6 , the lazy loading and routing has stopped working when I use ng serve. The route... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | kunal00731 |
| hostname | github.com |
| expected-hostname | github.com |
| None | cc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c |
| turbo-cache-control | no-preview |
| go-import | github.com/angular/angular-cli git https://github.com/angular/angular-cli.git |
| octolytics-dimension-user_id | 139426 |
| octolytics-dimension-user_login | angular |
| octolytics-dimension-repository_id | 36891867 |
| octolytics-dimension-repository_nwo | angular/angular-cli |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 36891867 |
| octolytics-dimension-repository_network_root_nwo | angular/angular-cli |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 8c77c9e8439031ad54c75a250694842892f693e1 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width