Open someApprentice opened 5 years ago
Stack trace from prod:
POST http://localhost:4000/api/login 404 (Not Found)
| scheduleTask | @ | zone.js:2969
-- | -- | -- | --
| push../node_modules/zone.js/dist/zone.js.ZoneDelegate.scheduleTask | @ | zone.js:407
| onScheduleTask | @ | zone.js:297
| push../node_modules/zone.js/dist/zone.js.ZoneDelegate.scheduleTask | @ | zone.js:401
| push../node_modules/zone.js/dist/zone.js.Zone.scheduleTask | @ | zone.js:232
| push../node_modules/zone.js/dist/zone.js.Zone.scheduleMacroTask | @ | zone.js:255
| scheduleMacroTaskWithCurrentZone | @ | zone.js:1114
| (anonymous) | @ | zone.js:3001
| proto.(anonymous function) | @ | zone.js:1394
| (anonymous) | @ | http.js:1630
| push../node_modules/rxjs/_esm5/internal/Observable.js.Observable._trySubscribe | @ | Observable.js:43
| push../node_modules/rxjs/_esm5/internal/Observable.js.Observable.subscribe | @ | Observable.js:29
| (anonymous) | @ | subscribeTo.js:21
| subscribeToResult | @ | subscribeToResult.js:11
| push../node_modules/rxjs/_esm5/internal/operators/mergeMap.js.MergeMapSubscriber._innerSub | @ | mergeMap.js:74
| push../node_modules/rxjs/_esm5/internal/operators/mergeMap.js.MergeMapSubscriber._tryNext | @ | mergeMap.js:68
| push../node_modules/rxjs/_esm5/internal/operators/mergeMap.js.MergeMapSubscriber._next | @ | mergeMap.js:51
| push../node_modules/rxjs/_esm5/internal/Subscriber.js.Subscriber.next | @ | Subscriber.js:54
| (anonymous) | @ | scalar.js:5
| push../node_modules/rxjs/_esm5/internal/Observable.js.Observable._trySubscribe | @ | Observable.js:43
| push../node_modules/rxjs/_esm5/internal/Observable.js.Observable.subscribe | @ | Observable.js:29
| push../node_modules/rxjs/_esm5/internal/operators/mergeMap.js.MergeMapOperator.call | @ | mergeMap.js:29
| push../node_modules/rxjs/_esm5/internal/Observable.js.Observable.subscribe | @ | Observable.js:24
| push../node_modules/rxjs/_esm5/internal/operators/filter.js.FilterOperator.call | @ | filter.js:15
| push../node_modules/rxjs/_esm5/internal/Observable.js.Observable.subscribe | @ | Observable.js:24
| push../node_modules/rxjs/_esm5/internal/operators/map.js.MapOperator.call | @ | map.js:18
| push../node_modules/rxjs/_esm5/internal/Observable.js.Observable.subscribe | @ | Observable.js:24
| push../node_modules/rxjs/_esm5/internal/operators/tap.js.DoOperator.call | @ | tap.js:18
| push../node_modules/rxjs/_esm5/internal/Observable.js.Observable.subscribe | @ | Observable.js:24
| push../node_modules/rxjs/_esm5/internal/operators/catchError.js.CatchOperator.call | @ | catchError.js:18
| push../node_modules/rxjs/_esm5/internal/Observable.js.Observable.subscribe | @ | Observable.js:24
| push../src/app/auth/login/login.component.ts.LoginComponent.login | @ | login.component.ts:46
| (anonymous) | @ | LoginComponent.html:1
| handleEvent | @ | core.js:21673
| callWithDebugContext | @ | core.js:22767
| debugHandleEvent | @ | core.js:22470
| dispatchEvent | @ | core.js:19122
| (anonymous) | @ | core.js:20612
| schedulerFn | @ | core.js:12621
| push../node_modules/rxjs/_esm5/internal/Subscriber.js.SafeSubscriber.__tryOrUnsub | @ | Subscriber.js:196
| push../node_modules/rxjs/_esm5/internal/Subscriber.js.SafeSubscriber.next | @ | Subscriber.js:134
| push../node_modules/rxjs/_esm5/internal/Subscriber.js.Subscriber._next | @ | Subscriber.js:77
| push../node_modules/rxjs/_esm5/internal/Subscriber.js.Subscriber.next | @ | Subscriber.js:54
| push../node_modules/rxjs/_esm5/internal/Subject.js.Subject.next | @ | Subject.js:47
| push../node_modules/@angular/core/fesm5/core.js.EventEmitter.emit | @ | core.js:12593
| push../node_modules/@angular/forms/fesm5/forms.js.FormGroupDirective.onSubmit | @ | forms.js:5253
| (anonymous) | @ | LoginComponent.html:1
| handleEvent | @ | core.js:21673
| callWithDebugContext | @ | core.js:22767
| debugHandleEvent | @ | core.js:22470
| dispatchEvent | @ | core.js:19122
| (anonymous) | @ | core.js:19569
| (anonymous) | @ | platform-browser.js:993
| push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask | @ | zone.js:421
| onInvokeTask | @ | core.js:16147
| push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask | @ | zone.js:420
| push../node_modules/zone.js/dist/zone.js.Zone.runTask | @ | zone.js:188
| push../node_modules/zone.js/dist/zone.js.ZoneTask.invokeTask | @ | zone.js:496
| invokeTask | @ | zone.js:1540
| globalZoneAwareCallback | @ | zone.js:1566
When authorization is failed API respond 404 status code and for this case an applications catches an error
https://github.com/someApprentice/Crypter/blob/master/src/app/auth/auth.service.ts#L36 https://github.com/someApprentice/Crypter/blob/master/src/app/auth/auth.service.ts#L61-L63
But somehow Angular throws the error anyway
Importing the
zone.js/dist/zone-error
in environment files doesn't actually affects anything.This behavior isn't occurs in the test environment via Karma/Jasmine.