{"action":"created","issue":{"url":"https://api.github.com/repos/angular/angular-cli/issues/3204","repository_url":"https://api.github.com/repos/angular/angular-cli","labels_url":"https://api.github.com/repos/angular/angular-cli/issues/3204/labels{/name}","comments_url":"https://api.github.com/repos/angular/angular-cli/issues/3204/comments","events_url":"https://api.github.com/repos/angular/angular-cli/issues/3204/events","html_url":"https://github.com/angular/angular-cli/issues/3204","id":190481632,"number":3204,"title":"ng build -aot error 'entry.split is not a function' on lazy loaded modules","user":{"login":"ctrl-brk","id":5613056,"avatar_url":"https://avatars.githubusercontent.com/u/5613056?v=3","gravatar_id":"","url":"https://api.github.com/users/ctrl-brk","html_url":"https://github.com/ctrl-brk","followers_url":"https://api.github.com/users/ctrl-brk/followers","following_url":"https://api.github.com/users/ctrl-brk/following{/other_user}","gists_url":"https://api.github.com/users/ctrl-brk/gists{/gist_id}","starred_url":"https://api.github.com/users/ctrl-brk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ctrl-brk/subscriptions","organizations_url":"https://api.github.com/users/ctrl-brk/orgs","repos_url":"https://api.github.com/users/ctrl-brk/repos","events_url":"https://api.github.com/users/ctrl-brk/events{/privacy}","received_events_url":"https://api.github.com/users/ctrl-brk/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":12,"created_at":"2016-11-19T07:09:44Z","updated_at":"2016-12-29T18:22:32Z","closed_at":"2016-12-29T18:22:32Z","body":"### OS?\r\n> Windows 10\r\n\r\n### Versions.\r\n1.0.0-beta.20-4\r\n\r\n### The log given by the failure.\r\nC:\\Projects\\Cli>ng build -prod -aot\r\n 10% building modules 2/2 modules 0 active entry.split is not a function\r\nTypeError: entry.split is not a function\r\n    at Function.ModuleRoute.fromString (C:\\Projects\\Cli\\node_modules\\@ngtools\\webpack\\src\\plugin.js:24:27)\r\n    at C:\\Projects\\Cli\\node_modules\\@ngtools\\webpack\\src\\plugin.js:244:34\r\n    at Array.map (native)\r\n    at AotPlugin._processNgModule (C:\\Projects\\Cli\\node_modules\\@ngtools\\webpack\\src\\plugin.js:243:14)\r\n    at C:\\Projects\\Cli\\node_modules\\@ngtools\\webpack\\src\\plugin.js:217:39\r\n    at process._tickCallback (internal/process/next_tick.js:103:7)\r\n\r\n### Mention any other details that might be useful.\r\nI understand that this feature is still under development but FYI...\r\nLine 24 of node_modules/@ngtools/webpack\\src\\plugin.js\r\n`var split = entry.split('#');`\r\nLooks like it expects SystemJs module path like `my.module#MyModule`\r\nBut this format doesn't work with webpack. In order to lazy load modules I use es6-promise-loader and it looks like this:\r\n```\r\nexport function loadMyModule() {\r\n  return require('es6-promise!./my.module')('MyModule');\r\n}\r\nexport const appRoutes: Routes = [\r\n    {path: 'my', loadChildren: loadMyModule},\r\n]\r\n\r\n```\r\nSo, the `entry` parameter of `ModuleRoute.fromString` (line 23) is not a string but rather something like this:\r\n```\r\nactiveStaticSymbol {\r\n  filePath: 'C:/Projects/Cli/src/app/app.routing.ts',\r\n  name: 'loadMyModule',\r\n  members: undefined }\r\n```"},"comment":{"url":"https://api.github.com/repos/angular/angular-cli/issues/comments/269670990","html_url":"https://github.com/angular/angular-cli/issues/3204#issuecomment-269670990","issue_url":"https://api.github.com/repos/angular/angular-cli/issues/3204","id":269670990,"user":{"login":"filipesilva","id":4172079,"avatar_url":"https://avatars.githubusercontent.com/u/4172079?v=3","gravatar_id":"","url":"https://api.github.com/users/filipesilva","html_url":"https://github.com/filipesilva","followers_url":"https://api.github.com/users/filipesilva/followers","following_url":"https://api.github.com/users/filipesilva/following{/other_user}","gists_url":"https://api.github.com/users/filipesilva/gists{/gist_id}","starred_url":"https://api.github.com/users/filipesilva/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/filipesilva/subscriptions","organizations_url":"https://api.github.com/users/filipesilva/orgs","repos_url":"https://api.github.com/users/filipesilva/repos","events_url":"https://api.github.com/users/filipesilva/events{/privacy}","received_events_url":"https://api.github.com/users/filipesilva/received_events","type":"User","site_admin":false},"created_at":"2016-12-29T18:22:32Z","updated_at":"2016-12-29T18:22:32Z","body":"@Meligy seems to working on a fix for this message in https://github.com/angular/angular/pull/13676.\r\n\r\nYou don't need to manually load lazy modules, webpack will pick it up correctly. See here for an example:\r\n\r\nhttps://github.com/angular/angular-cli/blob/master/tests/e2e/assets/webpack/test-app/app/app.module.ts#L21"}}
{"actor":{"display_login":"filipesilva"}}