{"action":"created","issue":{"url":"https://api.github.com/repos/devCrossNet/angular-cli/issues/38","repository_url":"https://api.github.com/repos/devCrossNet/angular-cli","labels_url":"https://api.github.com/repos/devCrossNet/angular-cli/issues/38/labels{/name}","comments_url":"https://api.github.com/repos/devCrossNet/angular-cli/issues/38/comments","events_url":"https://api.github.com/repos/devCrossNet/angular-cli/issues/38/events","html_url":"https://github.com/devCrossNet/angular-cli/issues/38","id":195270379,"number":38,"title":"Problem with routing and lazy modules (server side only)","user":{"login":"templth","id":558344,"avatar_url":"https://avatars.githubusercontent.com/u/558344?v=3","gravatar_id":"","url":"https://api.github.com/users/templth","html_url":"https://github.com/templth","followers_url":"https://api.github.com/users/templth/followers","following_url":"https://api.github.com/users/templth/following{/other_user}","gists_url":"https://api.github.com/users/templth/gists{/gist_id}","starred_url":"https://api.github.com/users/templth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/templth/subscriptions","organizations_url":"https://api.github.com/users/templth/orgs","repos_url":"https://api.github.com/users/templth/repos","events_url":"https://api.github.com/users/templth/events{/privacy}","received_events_url":"https://api.github.com/users/templth/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-12-13T14:41:41Z","updated_at":"2016-12-14T09:49:46Z","closed_at":null,"body":"> Please provide us with the following information:\r\n> ---------------------------------------------------------------\r\n\r\n### OS?\r\n\r\nLinux Mint\r\n\r\n### Versions.\r\n> Please run `ung --version`. If there's nothing outputted, please run in a Terminal: `node --version` and paste the result here:\r\n\r\nuniversal-cli: 1.0.0-alpha.universal.2-2\r\nangular-cli: 1.0.0-beta.20-1\r\nnode: 6.9.2\r\nos: linux x64\r\n\r\n### Repro steps.\r\n\r\nI have a problem on the server side to load lazy modules but it works on the client side with the same code.\r\n\r\nI use the following routing configuration in the main module of my application:\r\n\r\n```\r\nexport const routes: Routes = [\r\n  {\r\n    path: '',\r\n    component: WelcomeComponent\r\n  },\r\n  {\r\n    path: 'items',\r\n    loadChildren: 'app/modules/items/items.module#ItemsModule'\r\n  }\r\n];\r\n\r\nexport const AppRoutingModule: ModuleWithProviders = RouterModule.forRoot(routes);\r\n```\r\n\r\n### The log given by the failure.\r\n\r\nI have the following error when trying to load the page for the address `/items`:\r\n\r\n```\r\nEXCEPTION: Uncaught (in promise): ReferenceError: System is not defined\r\nReferenceError: System is not defined\r\n    at SystemJsNgModuleLoader.loadAndCompile (/.../myapp/node_modules/@angular/core/bundles/core.umd.js:7174:20)\r\n    at SystemJsNgModuleLoader.load (/.../myapp/node_modules/@angular/core/bundles/core.umd.js:7167:64)\r\n    at RouterConfigLoader.loadModuleFactory (/.../myapp/node_modules/@angular/router/bundles/router.umd.js:168:76)\r\n    at RouterConfigLoader.load (/.../myapp/node_modules/@angular/router/bundles/router.umd.js:160:52)\r\n    at MergeMapSubscriber.project (/.../myapp/node_modules/@angular/router/bundles/router.umd.js:903:82)\r\n    at MergeMapSubscriber._tryNext (/.../myapp/node_modules/rxjs/operator/mergeMap.js:110:27)\r\n    at MergeMapSubscriber._next (/.../myapp/node_modules/rxjs/operator/mergeMap.js:100:18)\r\n    at MergeMapSubscriber.Subscriber.next (/.../myapp/node_modules/rxjs/Subscriber.js:89:18)\r\n    at ScalarObservable._subscribe (/.../myapp/node_modules/rxjs/observable/ScalarObservable.js:49:24)\r\n    at ScalarObservable.Observable.subscribe (/.../myapp/node_modules/rxjs/Observable.js:56:27)\r\nORIGINAL STACKTRACE:\r\nError: Uncaught (in promise): ReferenceError: System is not defined\r\n```\r\n\r\nIt works when I navigate using a `routerLink`.\r\n\r\n### Mention any other details that might be useful.\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/devCrossNet/angular-cli/issues/comments/266990492","html_url":"https://github.com/devCrossNet/angular-cli/issues/38#issuecomment-266990492","issue_url":"https://api.github.com/repos/devCrossNet/angular-cli/issues/38","id":266990492,"user":{"login":"templth","id":558344,"avatar_url":"https://avatars.githubusercontent.com/u/558344?v=3","gravatar_id":"","url":"https://api.github.com/users/templth","html_url":"https://github.com/templth","followers_url":"https://api.github.com/users/templth/followers","following_url":"https://api.github.com/users/templth/following{/other_user}","gists_url":"https://api.github.com/users/templth/gists{/gist_id}","starred_url":"https://api.github.com/users/templth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/templth/subscriptions","organizations_url":"https://api.github.com/users/templth/orgs","repos_url":"https://api.github.com/users/templth/repos","events_url":"https://api.github.com/users/templth/events{/privacy}","received_events_url":"https://api.github.com/users/templth/received_events","type":"User","site_admin":false},"created_at":"2016-12-14T09:49:46Z","updated_at":"2016-12-14T09:49:46Z","body":"Hey Johannes! Thanks for your answer and your great project ;-)\r\n\r\nYes, I made a try but with no success. What isn't clear to me is: do I need to provide a custom configuration for angular2-router-loader (and what is it if needed) and do I need to update the module path in the Angular2 application (the `+` in this article: https://medium.com/@daviddentoom/angular-2-lazy-loading-with-webpack-d25fe71c29c1)?\r\n\r\nThanks!"}}
{"actor":{"display_login":"templth"}}