{"action":"created","issue":{"url":"https://api.github.com/repos/aspnet/JavaScriptServices/issues/299","repository_url":"https://api.github.com/repos/aspnet/JavaScriptServices","labels_url":"https://api.github.com/repos/aspnet/JavaScriptServices/issues/299/labels{/name}","comments_url":"https://api.github.com/repos/aspnet/JavaScriptServices/issues/299/comments","events_url":"https://api.github.com/repos/aspnet/JavaScriptServices/issues/299/events","html_url":"https://github.com/aspnet/JavaScriptServices/issues/299","id":175482253,"number":299,"title":"Error running ","user":{"login":"AndrewKralovec","id":6210337,"avatar_url":"https://avatars.githubusercontent.com/u/6210337?v=3","gravatar_id":"","url":"https://api.github.com/users/AndrewKralovec","html_url":"https://github.com/AndrewKralovec","followers_url":"https://api.github.com/users/AndrewKralovec/followers","following_url":"https://api.github.com/users/AndrewKralovec/following{/other_user}","gists_url":"https://api.github.com/users/AndrewKralovec/gists{/gist_id}","starred_url":"https://api.github.com/users/AndrewKralovec/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AndrewKralovec/subscriptions","organizations_url":"https://api.github.com/users/AndrewKralovec/orgs","repos_url":"https://api.github.com/users/AndrewKralovec/repos","events_url":"https://api.github.com/users/AndrewKralovec/events{/privacy}","received_events_url":"https://api.github.com/users/AndrewKralovec/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2016-09-07T11:47:54Z","updated_at":"2016-09-07T11:58:50Z","closed_at":null,"body":"I create a asp.net core/ Angular2 application using your yo project generator. It runs fine when i run it on my computer. However, when i add it to my sever and run the  `dotnet run`  and have it on port 5000, i am unable to access it. When i run node and other projects on my server it works just fine. Which leads me to believe that there is something wrong with the project. I read a post saying that its\r\nmore likely is that your app is only binding to the localhost address (i.e. 127.0.0.1) and not the public interface. and to add     `dotnet run --server.urls=http://0.0.0.0:5000` , but when i run that i get \r\n\r\n ```\r\ninfo: Microsoft.AspNetCore.Hosting.Internal.WebHost[1]\r\n      Request starting HTTP/1.1 GET http://localhost:5000/  \r\ninfo: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1]\r\n      Executing action method BlueWolf.Controllers.HomeController.Index (AndrewKralovec) with arguments () - ModelState is Valid\r\ninfo: Microsoft.AspNetCore.Mvc.ViewFeatures.Internal.ViewResultExecutor[1]\r\n      Executing ViewResult, running view at path /Views/Home/Index.cshtml.\r\ninfo: Microsoft.Extensions.DependencyInjection.DataProtectionServices[0]\r\n      User profile is available. Using '/home/andrew/.aspnet/DataProtection-Keys' as key repository; keys will not be encrypted at rest.\r\ninfo: Microsoft.AspNetCore.NodeServices[0]\r\n      Angular 2 is running in the development mode. Call enableProdMode() to enable the production mode.\r\nfail: Microsoft.AspNetCore.NodeServices[0]\r\n      EXCEPTION: ReferenceError: localStorage is not defined\r\nfail: Microsoft.AspNetCore.NodeServices[0]\r\n      STACKTRACE:\r\nfail: Microsoft.AspNetCore.NodeServices[0]\r\n      ReferenceError: localStorage is not defined\r\n          at LoginService.isLoggedIn (/home/andrew/workspace/CSharp/LinuxASP/AndrewKralovec/ClientApp/boot-server.js:1:2817)\r\n          at Home.ngOnInit (/home/andrew/workspace/CSharp/LinuxASP/AndrewKralovec/ClientApp/boot-server.js:1:25440)\r\n          at DebugAppView._View_Home_Host0.detectChangesInternal (Home.template.js:35:73)\r\n          at DebugAppView.AppView.detectChanges (/home/andrew/workspace/CSharp/LinuxASP/AndrewKralovec/node_modules/@angular/core/src/linker/view.js:243:14)\r\n          at DebugAppView.detectChanges (/home/andrew/workspace/CSharp/LinuxASP/AndrewKralovec/node_modules/@angular/core/src/linker/view.js:348:44)\r\n          at DebugAppView.AppView.detectContentChildrenChanges (/home/andrew/workspace/CSharp/LinuxASP/AndrewKralovec/node_modules/@angular/core/src/linker/view.js:261:19)\r\n          at DebugAppView.AppView.detectChangesInternal (/home/andrew/workspace/CSharp/LinuxASP/AndrewKralovec/node_modules/@angular/core/src/linker/view.js:253:14)\r\n          at DebugAppView.AppView.detectChanges (/home/andrew/workspace/CSharp/LinuxASP/AndrewKralovec/node_modules/@angular/core/src/linker/view.js:243:14)\r\n          at DebugAppView.detectChanges (/home/andrew/workspace/CSharp/LinuxASP/AndrewKralovec/node_modules/@angular/core/src/linker/view.js:348:44)\r\n          at DebugAppView.AppView.detectViewChildrenChanges (/home/andrew/workspace/CSharp/LinuxASP/AndrewKralovec/node_modules/@angular/core/src/linker/view.js:269:19)\r\n        -------------   Elapsed: 3 ms; At: Wed Sep 07 2016 06:44:04 GMT-0500 (CDT)   -------------  \r\n          at Object.Zone.longStackTraceZoneSpec.onScheduleTask (/home/andrew/workspace/CSharp/LinuxASP/AndrewKralovec/node_modules/zone.js/dist/long-stack-trace-zone.js:111:23)\r\n          at ZoneDelegate.scheduleTask (/home/andrew/workspace/CSharp/LinuxASP/AndrewKralovec/node_modules/zone.js/dist/zone-node.js:300:50)\r\n          at Zone.scheduleMicroTask (/home/andrew/workspace/CSharp/LinuxASP/AndrewKralovec/node_modules/zone.js/dist/zone-node.js:237:40)\r\n          at scheduleResolveOrReject (/home/andrew/workspace/CSharp/LinuxASP/AndrewKralovec/node_modules/zone.js/dist/zone-node.js:547:15)\r\n          at resolvePromise (/home/andrew/workspace/CSharp/LinuxASP/AndrewKralovec/node_modules/zone.js/dist/zone-node.js:511:22)\r\n          at /home/andrew/workspace/CSharp/LinuxASP/AndrewKralovec/node_modules/zone.js/dist/zone-node.js:493:14\r\n          at /home/andrew/workspace/CSharp/LinuxASP/AndrewKralovec/node_modules/@angular/router/src/router.js:349:17\r\n          at ZoneDelegate.invoke (/home/andrew/workspace/CSharp/LinuxASP/AndrewKralovec/node_modules/zone.js/dist/zone-node.js:290:29)\r\n        -------------   Elapsed: 2 ms; At: Wed Sep 07 2016 06:44:04 GMT-0500 (CDT)   -------------  \r\n          at Object.Zone.longStackTraceZoneSpec.onScheduleTask (/home/andrew/workspace/CSharp/LinuxASP/AndrewKralovec/node_modules/zone.js/dist/long-stack-trace-zone.js:111:23)\r\n          at ZoneDelegate.scheduleTask (/home/andrew/workspace/CSharp/LinuxASP/AndrewKralovec/node_modules/zone.js/dist/zone-node.js:300:50)\r\n          at Zone.scheduleMicroTask (/home/andrew/workspace/CSharp/LinuxASP/AndrewKralovec/node_modules/zone.js/dist/zone-node.js:237:40)\r\n          at scheduleResolveOrReject (/home/andrew/workspace/CSharp/LinuxASP/AndrewKralovec/node_modules/zone.js/dist/zone-node.js:547:15)\r\n          at resolvePromise (/home/andrew/workspace/CSharp/LinuxASP/AndrewKralovec/node_modules/zone.js/dist/zone-node.js:511:22)\r\n          at SafeSubscriber._complete (/home/andrew/workspace/CSharp/LinuxASP/AndrewKralovec/node_modules/zone.js/dist/zone-node.js:493:14)\r\n          at SafeSubscriber.__tryOrUnsub (/home/andrew/workspace/CSharp/LinuxASP/AndrewKralovec/node_modules/rxjs/Subscriber.js:225:16)\r\n          at SafeSubscriber.complete (/home/andrew/workspace/CSharp/LinuxASP/AndrewKralovec/node_modules/rxjs/Subscriber.js:210:26)\r\n        -------------   Elapsed: 27 ms; At: Wed Sep 07 2016 06:44:04 GMT-0500 (CDT)   -------------  \r\n          at Object.Zone.longStackTraceZoneSpec.onScheduleTask (/home/andrew/workspace/CSharp/LinuxASP/AndrewKralovec/node_modules/zone.js/dist/long-stack-trace-zone.js:111:23)\r\n          at ZoneDelegate.scheduleTask (/home/andrew/workspace/CSharp/LinuxASP/AndrewKralovec/node_modules/zone.js/dist/zone-node.js:300:50)\r\n          at Zone.scheduleMicroTask (/home/andrew/workspace/CSharp/LinuxASP/AndrewKralovec/node_modules/zone.js/dist/zone-node.js:237:40)\r\n          at scheduleResolveOrReject (/home/andrew/workspace/CSharp/LinuxASP/AndrewKralovec/node_modules/zone.js/dist/zone-node.js:547:15)\r\n          at resolvePromise (/home/andrew/workspace/CSharp/LinuxASP/AndrewKralovec/node_modules/zone.js/dist/zone-node.js:511:22)\r\n          at /home/andrew/workspace/CSharp/LinuxASP/AndrewKralovec/node_modules/zone.js/dist/zone-node.js:493:14\r\n          at SafeSubscriber._complete (/home/andrew/workspace/CSharp/LinuxASP/AndrewKralovec/node_modules/rxjs/operator/toPromise.js:24:122)\r\n          at SafeSubscriber.__tryOrUnsub (/home/andrew/workspace/CSharp/LinuxASP/AndrewKralovec/node_modules/rxjs/Subscriber.js:225:16)\r\n        -------------   Elapsed: 0 ms; At: Wed Sep 07 2016 06:44:04 GMT-0500 (CDT)   -------------  \r\n          at Object.Zone.longStackTraceZoneSpec.onScheduleTask (/home/andrew/workspace/CSharp/LinuxASP/AndrewKralovec/node_modules/zone.js/dist/long-stack-trace-zone.js:111:23)\r\n          at ZoneDelegate.scheduleTask (/home/andrew/workspace/CSharp/LinuxASP/AndrewKralovec/node_modules/zone.js/dist/zone-node.js:300:50)\r\n          at Zone.scheduleMicroTask (/home/andrew/workspace/CSharp/LinuxASP/AndrewKralovec/node_modules/zone.js/dist/zone-node.js:237:40)\r\n          at scheduleResolveOrReject (/home/andrew/workspace/CSharp/LinuxASP/AndrewKralovec/node_modules/zone.js/dist/zone-node.js:547:15)\r\n          at resolvePromise (/home/andrew/workspace/CSharp/LinuxASP/AndrewKralovec/node_modules/zone.js/dist/zone-node.js:511:22)\r\n          at /home/andrew/workspace/CSharp/LinuxASP/AndrewKralovec/node_modules/zone.js/dist/zone-node.js:549:18\r\n          at ZoneDelegate.invokeTask (/home/andrew/workspace/CSharp/LinuxASP/AndrewKralovec/node_modules/zone.js/dist/zone-node.js:323:38)\r\n          at Object.NgZoneImpl.inner.inner.fork.onInvokeTask (/home/andrew/workspace/CSharp/LinuxASP/AndrewKralovec/node_modules/@angular/core/src/zone/ng_zone_impl.js:44:41)\r\n        -------------   Elapsed: 0 ms; At: Wed Sep 07 2016 06:44:04 GMT-0500 (CDT)   -------------  \r\n          at Object.Zone.longStackTraceZoneSpec.onScheduleTask (/home/andrew/workspace/CSharp/LinuxASP/AndrewKralovec/node_modules/zone.js/dist/long-stack-trace-zone.js:111:23)\r\n          at ZoneDelegate.scheduleTask (/home/andrew/workspace/CSharp/LinuxASP/AndrewKralovec/node_modules/zone.js/dist/zone-node.js:300:50)\r\n          at Zone.scheduleMicroTask (/home/andrew/workspace/CSharp/LinuxASP/AndrewKralovec/node_modules/zone.js/dist/zone-node.js:237:40)\r\n          at scheduleResolveOrReject (/home/andrew/workspace/CSharp/LinuxASP/AndrewKralovec/node_modules/zone.js/dist/zone-node.js:547:15)\r\n          at resolvePromise (/home/andrew/workspace/CSharp/LinuxASP/AndrewKralovec/node_modules/zone.js/dist/zone-node.js:511:22)\r\n          at /home/andrew/workspace/CSharp/LinuxASP/AndrewKralovec/node_modules/zone.js/dist/zone-node.js:549:18\r\n          at ZoneDelegate.invokeTask (/home/andrew/workspace/CSharp/LinuxASP/AndrewKralovec/node_modules/zone.js/dist/zone-node.js:323:38)\r\n          at Object.NgZoneImpl.inner.inner.fork.onInvokeTask (/home/andrew/workspace/CSharp/LinuxASP/AndrewKralovec/node_modules/@angular/core/src/zone/ng_zone_impl.js:44:41)\r\n        -------------   Elapsed: 54 ms; At: Wed Sep 07 2016 06:44:04 GMT-0500 (CDT)   -------------  \r\n          at Object.Zone.longStackTraceZoneSpec.onScheduleTask (/home/andrew/workspace/CSharp/LinuxASP/AndrewKralovec/node_modules/zone.js/dist/long-stack-trace-zone.js:111:23)\r\n          at ZoneDelegate.scheduleTask (/home/andrew/workspace/CSharp/LinuxASP/AndrewKralovec/node_modules/zone.js/dist/zone-node.js:300:50)\r\n          at Zone.scheduleMicroTask (/home/andrew/workspace/CSharp/LinuxASP/AndrewKralovec/node_modules/zone.js/dist/zone-node.js:237:40)\r\n          at scheduleResolveOrReject (/home/andrew/workspace/CSharp/LinuxASP/AndrewKralovec/node_modules/zone.js/dist/zone-node.js:547:15)\r\n          at ZoneAwarePromise.then (/home/andrew/workspace/CSharp/LinuxASP/AndrewKralovec/node_modules/zone.js/dist/zone-node.js:625:18)\r\n          at RuntimeCompiler.compileComponentAsync (/home/andrew/workspace/CSharp/LinuxASP/AndrewKralovec/node_modules/@angular/compiler/src/runtime_compiler.js:50:45)\r\n          at RuntimeCompiler.resolveComponent (/home/andrew/workspace/CSharp/LinuxASP/AndrewKralovec/node_modules/@angular/compiler/src/runtime_compiler.js:39:21)\r\n          at resolveComponent (/home/andrew/workspace/CSharp/LinuxASP/AndrewKralovec/node_modules/@angular/router/src/resolve.js:35:25)\r\n        -------------   Elapsed: 18 ms; At: Wed Sep 07 2016 06:44:04 GMT-0500 (CDT)   -------------  \r\n          at Object.Zone.longStackTraceZoneSpec.onScheduleTask (/home/andrew/workspace/CSharp/LinuxASP/AndrewKralovec/node_modules/zone.js/dist/long-stack-trace-zone.js:111:23)\r\n          at ZoneDelegate.scheduleTask (/home/andrew/workspace/CSharp/LinuxASP/AndrewKralovec/node_modules/zone.js/dist/zone-node.js:300:50)\r\n          at Zone.scheduleMicroTask (/home/andrew/workspace/CSharp/LinuxASP/AndrewKralovec/node_modules/zone.js/dist/zone-node.js:237:40)\r\n          at scheduleResolveOrReject (/home/andrew/workspace/CSharp/LinuxASP/AndrewKralovec/node_modules/zone.js/dist/zone-node.js:547:15)\r\n          at ZoneAwarePromise.then (/home/andrew/workspace/CSharp/LinuxASP/AndrewKralovec/node_modules/zone.js/dist/zone-node.js:625:18)\r\n          at Router.scheduleNavigation (/home/andrew/workspace/CSharp/LinuxASP/AndrewKralovec/node_modules/@angular/router/src/router.js:278:34)\r\n          at Router.navigateByUrl (/home/andrew/workspace/CSharp/LinuxASP/AndrewKralovec/node_modules/@angular/router/src/router.js:244:25)\r\n          at Router.initialNavigation (/home/andrew/workspace/CSharp/LinuxASP/AndrewKralovec/node_modules/@angular/router/src/router.js:140:14)\r\n        -------------   Elapsed: 491 ms; At: Wed Sep 07 2016 06:44:04 GMT-0500 (CDT)   -------------  \r\n          at Object.Zone.longStackTraceZoneSpec.onScheduleTask (/home/andrew/workspace/CSharp/LinuxASP/AndrewKralovec/node_modules/zone.js/dist/long-stack-trace-zone.js:111:23)\r\n          at ZoneDelegate.scheduleTask (/home/andrew/workspace/CSharp/LinuxASP/AndrewKralovec/node_modules/zone.js/dist/zone-node.js:300:50)\r\n          at Zone.scheduleMacroTask (/home/andrew/workspace/CSharp/LinuxASP/AndrewKralovec/node_modules/zone.js/dist/zone-node.js:240:40)\r\n          at /home/andrew/workspace/CSharp/LinuxASP/AndrewKralovec/node_modules/zone.js/dist/zone-node.js:683:30\r\n          at setTimeout (eval at createNamedFn (/home/andrew/workspace/CSharp/LinuxASP/AndrewKralovec/node_modules/zone.js/dist/zone-node.js:1000:18), <anonymous>:3:37)\r\n          at setupRouterInitializer (/home/andrew/workspace/CSharp/LinuxASP/AndrewKralovec/node_modules/@angular/router/src/common_router_providers.js:39:5)\r\n          at ReflectiveInjector_._instantiate (/home/andrew/workspace/CSharp/LinuxASP/AndrewKralovec/node_modules/@angular/core/src/di/reflective_injector.js:698:27)\r\n          at ReflectiveInjector_._instantiateProvider (/home/andrew/workspace/CSharp/LinuxASP/AndrewKralovec/node_modules/@angular/core/src/di/reflective_injector.js:631:31)\r\ninfo: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2]\r\n      Executed action BlueWolf.Controllers.HomeController.Index (AndrewKralovec) in 38108.7536ms\r\ninfo: Microsoft.AspNetCore.Hosting.Internal.WebHost[2]\r\n      Request finished in 39014.9737ms 200 text/html; charset=utf-8\r\ninfo: Microsoft.AspNetCore.Hosting.Internal.WebHost[1]\r\n      Request starting HTTP/1.1 GET http://localhost:5000/dist/main.js?v=4n0eskTDCwzX-wG5AzFi94MrB5uBlBf1ms1dhBe3a1Q  \r\ninfo: Microsoft.AspNetCore.Hosting.Internal.WebHost[1]\r\n      Request starting HTTP/1.1 GET http://localhost:5000/dist/vendor.js?v=vJS8eKn1wDZpNKE-SYnibVC_KjaoGWg8SWZh1HVH2iY  \r\ninfo: Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware[2]\r\n      Sending file. Request path: '/dist/vendor.js'. Physical path: '/home/andrew/workspace/CSharp/LinuxASP/AndrewKralovec/wwwroot/dist/vendor.js'\r\ninfo: Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware[2]\r\n      Sending file. Request path: '/dist/main.js'. Physical path: '/home/andrew/workspace/CSharp/LinuxASP/AndrewKralovec/wwwroot/dist/main.js'\r\ninfo: Microsoft.AspNetCore.Hosting.Internal.WebHost[2]\r\n      Request finished in 151.1644ms 200 application/javascript\r\ninfo: Microsoft.AspNetCore.Hosting.Internal.WebHost[2]\r\n      Request finished in 84.1983ms 200 application/javascript\r\ninfo: Microsoft.AspNetCore.Hosting.Internal.WebHost[1]\r\n      Request starting HTTP/1.1 GET http://localhost:5000/images/Front.jpg  \r\ninfo: Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware[6]\r\n      The file /images/Front.jpg was not modified\r\ninfo: Microsoft.AspNetCore.Hosting.Internal.WebHost[2]\r\n      Request finished in 6.0563ms 304 image/jpeg\r\n```\r\n\r\nHow do i resolve this issue ? My project can be found [here](https://github.com/AndrewKralovec/Forecast-Report) "},"comment":{"url":"https://api.github.com/repos/aspnet/JavaScriptServices/issues/comments/245258276","html_url":"https://github.com/aspnet/JavaScriptServices/issues/299#issuecomment-245258276","issue_url":"https://api.github.com/repos/aspnet/JavaScriptServices/issues/299","id":245258276,"user":{"login":"MarkPieszak","id":2574412,"avatar_url":"https://avatars.githubusercontent.com/u/2574412?v=3","gravatar_id":"","url":"https://api.github.com/users/MarkPieszak","html_url":"https://github.com/MarkPieszak","followers_url":"https://api.github.com/users/MarkPieszak/followers","following_url":"https://api.github.com/users/MarkPieszak/following{/other_user}","gists_url":"https://api.github.com/users/MarkPieszak/gists{/gist_id}","starred_url":"https://api.github.com/users/MarkPieszak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MarkPieszak/subscriptions","organizations_url":"https://api.github.com/users/MarkPieszak/orgs","repos_url":"https://api.github.com/users/MarkPieszak/repos","events_url":"https://api.github.com/users/MarkPieszak/events{/privacy}","received_events_url":"https://api.github.com/users/MarkPieszak/received_events","type":"User","site_admin":false},"created_at":"2016-09-07T11:58:50Z","updated_at":"2016-09-07T11:58:50Z","body":"So unfortunately the server side doesn't know what localStorage, window, jQuery and other things don't exist on the server, you'll need to use Dependency Injection to tell both the server and browser platforms what Storage is.\r\n\r\nCheck out the code here for an example of it: https://github.com/gdi2290/ng-conf-2016-universal-patterns/tree/master/3-di-demo\r\n\r\n\r\nBasically you need to abstract a Storage class, that the server and browser implement completely differently. Let's say Redis for the server, and localStorage for the browser in your case."}}
{"actor":{"display_login":"MarkPieszak"}}