Base solution for your next web application
Open Closed

Cannot load localhost:4200 for Mac. #7753


User avatar
0
dev.touchpoint created

Hi support team, I'm using ASP.NET Core Angular v6.9.0 on Mac.

I followed Running ASP.NET Zero on Mac but I'm getting this error when tried to load Angular:

Error details:

OPTIONS http://localhost:22742/AbpUserConfiguration/GetAll?d=1569707008563 net::ERR_CONNECTION_REFUSED
scheduleTask	@	zone.js:3338
push../node_modules/zone.js/dist/zone.js.ZoneDelegate.scheduleTask	@	zone.js:410
onScheduleTask	@	zone.js:301
push../node_modules/zone.js/dist/zone.js.ZoneDelegate.scheduleTask	@	zone.js:404
push../node_modules/zone.js/dist/zone.js.Zone.scheduleTask	@	zone.js:238
push../node_modules/zone.js/dist/zone.js.Zone.scheduleMacroTask	@	zone.js:261
scheduleMacroTaskWithCurrentZone	@	zone.js:1194
(anonymous)	@	zone.js:3371
proto.<computed>	@	zone.js:1518
push../src/shared/helpers/XmlHttpRequestHelper.ts.XmlHttpRequestHelper.ajax	@	XmlHttpRequestHelper.ts:30
push../src/AppPreBootstrap.ts.AppPreBootstrap.getUserConfiguration	@	AppPreBootstrap.ts:148
(anonymous)	@	AppPreBootstrap.ts:37
(anonymous)	@	AppPreBootstrap.ts:71
xhr.onreadystatechange	@	XmlHttpRequestHelper.ts:10
wrapFn	@	zone.js:1281
push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask	@	zone.js:423
onInvokeTask	@	core.js:17290
push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask	@	zone.js:422
push../node_modules/zone.js/dist/zone.js.Zone.runTask	@	zone.js:195
push../node_modules/zone.js/dist/zone.js.ZoneTask.invokeTask	@	zone.js:498
invokeTask	@	zone.js:1693
globalZoneAwareCallback	@	zone.js:1719
XMLHttpRequest.send (async)		
scheduleTask	@	zone.js:3338
push../node_modules/zone.js/dist/zone.js.ZoneDelegate.scheduleTask	@	zone.js:410
onScheduleTask	@	zone.js:301
push../node_modules/zone.js/dist/zone.js.ZoneDelegate.scheduleTask	@	zone.js:404
push../node_modules/zone.js/dist/zone.js.Zone.scheduleTask	@	zone.js:238
push../node_modules/zone.js/dist/zone.js.Zone.scheduleMacroTask	@	zone.js:261
scheduleMacroTaskWithCurrentZone	@	zone.js:1194
(anonymous)	@	zone.js:3371
proto.<computed>	@	zone.js:1518
push../src/shared/helpers/XmlHttpRequestHelper.ts.XmlHttpRequestHelper.ajax	@	XmlHttpRequestHelper.ts:30
push../src/AppPreBootstrap.ts.AppPreBootstrap.getApplicationConfig	@	AppPreBootstrap.ts:55
push../src/AppPreBootstrap.ts.AppPreBootstrap.run	@	AppPreBootstrap.ts:18
(anonymous)	@	root.module.ts:46
ZoneAwarePromise	@	zone.js:931
(anonymous)	@	root.module.ts:42
push../node_modules/@angular/core/fesm5/core.js.ApplicationInitStatus.runInitializers	@	core.js:16739
(anonymous)	@	core.js:17774
_callAndReportToErrorHandler	@	core.js:17867
(anonymous)	@	core.js:17772
push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invoke	@	zone.js:391
onInvoke	@	core.js:17299
push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invoke	@	zone.js:390
push../node_modules/zone.js/dist/zone.js.Zone.run	@	zone.js:150
push../node_modules/@angular/core/fesm5/core.js.NgZone.run	@	core.js:17213
push../node_modules/@angular/core/fesm5/core.js.PlatformRef.bootstrapModuleFactory	@	core.js:17763
(anonymous)	@	core.js:17803
push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invoke	@	zone.js:391
push../node_modules/zone.js/dist/zone.js.Zone.run	@	zone.js:150
(anonymous)	@	zone.js:910
push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask	@	zone.js:423
push../node_modules/zone.js/dist/zone.js.Zone.runTask	@	zone.js:195
drainMicroTaskQueue	@	zone.js:601
Promise.then (async)		
scheduleMicroTask	@	zone.js:584
push../node_modules/zone.js/dist/zone.js.ZoneDelegate.scheduleTask	@	zone.js:413
push../node_modules/zone.js/dist/zone.js.Zone.scheduleTask	@	zone.js:238
push../node_modules/zone.js/dist/zone.js.Zone.scheduleMicroTask	@	zone.js:258
scheduleResolveOrReject	@	zone.js:900
ZoneAwarePromise.then	@	zone.js:1040
setDriver	@	localforage.js:2730
LocalForage	@	localforage.js:2519
4.3	@	localforage.js:2792
s	@	localforage.js:7
e	@	localforage.js:7
(anonymous)	@	localforage.js:7
(anonymous)	@	localforage.js:7
./node_modules/localforage/dist/localforage.js	@	localforage.js:7
__webpack_require__	@	bootstrap:83
./src/root.module.ts	@	root.component.ts:7
__webpack_require__	@	bootstrap:83
./src/main.ts	@	main.ts:1
__webpack_require__	@	bootstrap:83
0	@	password-complexity-…tor.directive.ts:10
__webpack_require__	@	bootstrap:83
checkDeferredModules	@	bootstrap:45
webpackJsonpCallback	@	bootstrap:32
(anonymous)	@	main.js:1

This is my dotnet information:

Thanks, Kenny.


13 Answer(s)
  • User Avatar
    0
    maliming created
    Support Team

    Are you running a backend application?

    https://docs.aspnetzero.com/documents/aspnet-core-angular/latest/Getting-Started-Angular#run-api-host

  • User Avatar
    0
    dev.touchpoint created

    Hi,

    What do you mean by backend application? The tables are successfully added to my database and I'm able to load http://localhost:5001.

    I followed the document but the form is failed to load after I run npm start.

    Thanks, Kenny.

  • User Avatar
    0
    maliming created
    Support Team

    If the url of your backend application is not http://localhost:22742

    You can modify it in angular\src\assets\appconfig.json (http://localhost:5001)

  • User Avatar
    0
    dev.touchpoint created

    Thanks for the quick response,

    Sorry about the image I posted at the first place is the old one, I already changed to http://localhost:5001 but still doesn't work.

    The request to http://localhost:5001/AbpUserConfiguration/GetAll?d=1569707008563 is still failed but the error message is not net::ERR_CONNECTION_REFUSED if I'm not mistaken. My Mac is not with me now, I will provide the error message once I got it.

    Thanks, Kenny.

  • User Avatar
    0
    dev.touchpoint created

    Hi, the error message is little bit different from the first that I posted:

    OPTIONS http://localhost:5001/AbpUserConfiguration/GetAll?d=1569836115628 net::ERR_EMPTY_RESPONSE
    scheduleTask	@	zone.js:3338
    push../node_modules/zone.js/dist/zone.js.ZoneDelegate.scheduleTask	@	zone.js:410
    onScheduleTask	@	zone.js:301
    push../node_modules/zone.js/dist/zone.js.ZoneDelegate.scheduleTask	@	zone.js:404
    push../node_modules/zone.js/dist/zone.js.Zone.scheduleTask	@	zone.js:238
    push../node_modules/zone.js/dist/zone.js.Zone.scheduleMacroTask	@	zone.js:261
    scheduleMacroTaskWithCurrentZone	@	zone.js:1194
    (anonymous)	@	zone.js:3371
    proto.<computed>	@	zone.js:1518
    push../src/shared/helpers/XmlHttpRequestHelper.ts.XmlHttpRequestHelper.ajax	@	XmlHttpRequestHelper.ts:30
    push../src/AppPreBootstrap.ts.AppPreBootstrap.getUserConfiguration	@	AppPreBootstrap.ts:148
    (anonymous)	@	AppPreBootstrap.ts:37
    (anonymous)	@	AppPreBootstrap.ts:71
    xhr.onreadystatechange	@	XmlHttpRequestHelper.ts:10
    wrapFn	@	zone.js:1281
    push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask	@	zone.js:423
    onInvokeTask	@	core.js:17290
    push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask	@	zone.js:422
    push../node_modules/zone.js/dist/zone.js.Zone.runTask	@	zone.js:195
    push../node_modules/zone.js/dist/zone.js.ZoneTask.invokeTask	@	zone.js:498
    invokeTask	@	zone.js:1693
    globalZoneAwareCallback	@	zone.js:1719
    XMLHttpRequest.send (async)		
    scheduleTask	@	zone.js:3338
    push../node_modules/zone.js/dist/zone.js.ZoneDelegate.scheduleTask	@	zone.js:410
    onScheduleTask	@	zone.js:301
    push../node_modules/zone.js/dist/zone.js.ZoneDelegate.scheduleTask	@	zone.js:404
    push../node_modules/zone.js/dist/zone.js.Zone.scheduleTask	@	zone.js:238
    push../node_modules/zone.js/dist/zone.js.Zone.scheduleMacroTask	@	zone.js:261
    scheduleMacroTaskWithCurrentZone	@	zone.js:1194
    (anonymous)	@	zone.js:3371
    proto.<computed>	@	zone.js:1518
    push../src/shared/helpers/XmlHttpRequestHelper.ts.XmlHttpRequestHelper.ajax	@	XmlHttpRequestHelper.ts:30
    push../src/AppPreBootstrap.ts.AppPreBootstrap.getApplicationConfig	@	AppPreBootstrap.ts:55
    push../src/AppPreBootstrap.ts.AppPreBootstrap.run	@	AppPreBootstrap.ts:18
    (anonymous)	@	root.module.ts:46
    ZoneAwarePromise	@	zone.js:931
    (anonymous)	@	root.module.ts:42
    push../node_modules/@angular/core/fesm5/core.js.ApplicationInitStatus.runInitializers	@	core.js:16739
    (anonymous)	@	core.js:17774
    _callAndReportToErrorHandler	@	core.js:17867
    (anonymous)	@	core.js:17772
    push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invoke	@	zone.js:391
    onInvoke	@	core.js:17299
    push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invoke	@	zone.js:390
    push../node_modules/zone.js/dist/zone.js.Zone.run	@	zone.js:150
    push../node_modules/@angular/core/fesm5/core.js.NgZone.run	@	core.js:17213
    push../node_modules/@angular/core/fesm5/core.js.PlatformRef.bootstrapModuleFactory	@	core.js:17763
    (anonymous)	@	core.js:17803
    push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invoke	@	zone.js:391
    push../node_modules/zone.js/dist/zone.js.Zone.run	@	zone.js:150
    (anonymous)	@	zone.js:910
    push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask	@	zone.js:423
    push../node_modules/zone.js/dist/zone.js.Zone.runTask	@	zone.js:195
    drainMicroTaskQueue	@	zone.js:601
    Promise.then (async)		
    scheduleMicroTask	@	zone.js:584
    push../node_modules/zone.js/dist/zone.js.ZoneDelegate.scheduleTask	@	zone.js:413
    push../node_modules/zone.js/dist/zone.js.Zone.scheduleTask	@	zone.js:238
    push../node_modules/zone.js/dist/zone.js.Zone.scheduleMicroTask	@	zone.js:258
    scheduleResolveOrReject	@	zone.js:900
    ZoneAwarePromise.then	@	zone.js:1040
    setDriver	@	localforage.js:2730
    LocalForage	@	localforage.js:2519
    4.3	@	localforage.js:2792
    s	@	localforage.js:7
    e	@	localforage.js:7
    (anonymous)	@	localforage.js:7
    (anonymous)	@	localforage.js:7
    ./node_modules/localforage/dist/localforage.js	@	localforage.js:7
    __webpack_require__	@	bootstrap:83
    ./src/root.module.ts	@	root.component.ts:7
    __webpack_require__	@	bootstrap:83
    ./src/main.ts	@	main.ts:1
    __webpack_require__	@	bootstrap:83
    0	@	password-complexity-…tor.directive.ts:10
    __webpack_require__	@	bootstrap:83
    checkDeferredModules	@	bootstrap:45
    webpackJsonpCallback	@	bootstrap:32
    (anonymous)	@	main.js:1
    

    And I already configured same as my backend application:

    Thanks, Kenny.

  • User Avatar
    0
    maliming created
    Support Team

    Can you check the logs of the application backend?

    App_Data/Logs/Logs.txt

  • User Avatar
    0
    dev.touchpoint created

    No error message is found in Logs.txt:

  • User Avatar
    0
    maliming created
    Support Team

    hi dev.touchpoint Can you share the full log? Or upload your log txt file. If there is private data in the log,please send the log file to email [email protected]

  • User Avatar
    0
    dev.touchpoint created

    There you go: Logs.txt.

    Thanks, Kenny.

  • User Avatar
    0
    maliming created
    Support Team

    hi dev.touchpoint

    Is it convenient to view it remotely? We can use teamviewer.

    If you can, please send me your connection username and password. [email protected]

  • User Avatar
    0
    dev.touchpoint created

    Hi,

    Sure no problem, please wait.

    Thanks, Kenny.

  • User Avatar
    0
    maliming created
    Support Team

    Solved by remote. : )

  • User Avatar
    0
    dev.touchpoint created

    Solution is set the remoteServiceBaseUrl with https, instead of http:

    Due to I've created a dev-cert: Enforce HTTPS in ASP.NET Core

    Else you can just set with http://localhost:4200

    Thanks, Kenny.