{"action":"opened","issue":{"url":"https://api.github.com/repos/angular/angular-cli/issues/827","repository_url":"https://api.github.com/repos/angular/angular-cli","labels_url":"https://api.github.com/repos/angular/angular-cli/issues/827/labels{/name}","comments_url":"https://api.github.com/repos/angular/angular-cli/issues/827/comments","events_url":"https://api.github.com/repos/angular/angular-cli/issues/827/events","html_url":"https://github.com/angular/angular-cli/issues/827","id":155551575,"number":827,"title":"ng serve -prod: application not loaded, but no errors logged in console","user":{"login":"theimdal","id":11312750,"avatar_url":"https://avatars.githubusercontent.com/u/11312750?v=3","gravatar_id":"","url":"https://api.github.com/users/theimdal","html_url":"https://github.com/theimdal","followers_url":"https://api.github.com/users/theimdal/followers","following_url":"https://api.github.com/users/theimdal/following{/other_user}","gists_url":"https://api.github.com/users/theimdal/gists{/gist_id}","starred_url":"https://api.github.com/users/theimdal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/theimdal/subscriptions","organizations_url":"https://api.github.com/users/theimdal/orgs","repos_url":"https://api.github.com/users/theimdal/repos","events_url":"https://api.github.com/users/theimdal/events{/privacy}","received_events_url":"https://api.github.com/users/theimdal/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-05-18T16:53:47Z","updated_at":"2016-05-18T16:53:47Z","closed_at":null,"body":"> Please provide us with the following information:\r\n> ---------------------------------------------------------------\r\n1. OS?  Windows 7, 8 or 10. Linux (which distribution). Mac OSX (Yosemite? El Capitan?)\r\nWindows 7.\r\n\r\n\r\n2. Versions. Please run `ng --version`. If there's nothing outputted, please\r\n   run in a Terminal: \r\n        node --version\r\n   And paste the result here.\r\n\r\nangular-cli: 1.0.0-beta.1\r\nnode: 5.11.0\r\nos: win32 x64\r\n\r\n3. Repro steps. Was this an app that wasn't created using the CLI? What change did you\r\n   do on your code? etc.\r\n\r\nCreated an application using the CLI, then moved my existing ng2 application into the new project. I'm using a couple of 3rd party libs, and also the deprecated router.\r\n\r\nHere is my system.config.ts:\r\n\r\n/***********************************************************************************************\r\n * User Configuration.\r\n **********************************************************************************************/\r\n/** Map relative paths to URLs. */\r\nconst map: any = {\r\n  'moment':                     'vendor/moment/moment.js',\r\n  'primeng':                    'vendor/primeng',\r\n  'underscore':                 'vendor/underscore/underscore.js'\r\n};\r\n\r\n/** User packages configuration. */\r\nconst packages: any = {\r\n  'primeng': {\r\n    defaultExtension: 'js'\r\n  }\r\n};\r\n\r\n////////////////////////////////////////////////////////////////////////////////////////////////\r\n/***********************************************************************************************\r\n * Everything underneath this line is managed by the CLI.\r\n **********************************************************************************************/\r\nconst barrels: string[] = [\r\n  // Angular specific barrels.\r\n  '@angular/core',\r\n  '@angular/common',\r\n  '@angular/compiler',\r\n  '@angular/http',\r\n  '@angular/router',\r\n  '@angular/platform-browser',\r\n  '@angular/platform-browser-dynamic',\r\n  '@angular/router-deprecated',\r\n\r\n  // Thirdparty barrels.\r\n  'rxjs',\r\n\r\n  // App specific barrels.\r\n  'app',\r\n  'app/shared',\r\n  /** @cli-barrel */\r\n];\r\n\r\nconst cliSystemConfigPackages: any = {};\r\nbarrels.forEach((barrelName: string) => {\r\n  cliSystemConfigPackages[barrelName] = { main: 'index' };\r\n});\r\n\r\n/** Type declaration for ambient System. */\r\ndeclare var System: any;\r\n\r\n// Apply the CLI SystemJS configuration.\r\nSystem.config({\r\n  map: {\r\n    '@angular': 'vendor/@angular',\r\n    'rxjs': 'vendor/rxjs',\r\n    'main': 'main.js'\r\n  },\r\n  packages: cliSystemConfigPackages\r\n});\r\n\r\n// Apply the user's configuration.\r\nSystem.config({ map, packages });\r\n\r\nAnd this works fine when serving the application in development mode!\r\n\r\n4. The log given by the failure. Normally this include a stack trace and some\r\n   more information.\r\n\r\nHowever, when building the application for production and serving it, it is stuck in \"Loading...\", and there is no error logged in the console. As far as i'm able to debug, I see that the application is able to run system.import('main') and that systemjs is trying to import main, but after that I'm not able to make sense of what happens.\r\n\r\n5. Mention any other details that might be useful.\r\n\r\nThis is the output after running serve -prod:\r\n\r\n$ ng serve -prod\r\nLivereload server on http://localhost:49152\r\nServing on http://localhost:4200/\r\n\r\nBuild successful - 22085ms.\r\n\r\nSlowest Trees                                 | Total\r\n----------------------------------------------+---------------------\r\nBundlePlugin                                  | 12381ms\r\nFunnel                                             | 4792ms\r\nvendor                                             | 2007ms\r\nBroccoliTypeScriptCompiler          | 1800ms\r\n\r\nSlowest Trees (cumulative)           | Total (avg)\r\n----------------------------------------------+---------------------\r\nBundlePlugin (1)                              | 12381ms\r\nFunnel (10)                                       | 5561ms (556 ms)\r\nvendor (1)                                         | 2007ms\r\nBroccoliTypeScriptCompiler (1)      | 1800ms\r\n\r\nI have also tried \"build -prod\" and serving the dist folder in lite-server, but with the same result.\r\n\r\nI see that this is very vague, but I'm not sure what information is needed to solve this. I will try to dissect my own application to see what I need to exclude to get it running in production mode.\r\n"}}