Open jnavarrovera opened 5 years ago
I've been investigating and I found that if I remove my interceptor, it works. I have others applications with both, interceptors and ngx-translate, and they works, the only diference is angular version (7 working, 8 not working)
Someone has any clue?
Thanks!
I have started to observe the same problem after upgrading to Angular 8. Can't pin it down to anything specific, yet.
What is strange is the fact that the application still works, it just throws this error from time to time...
I've been investigating and I found that if I remove my interceptor, it works. I have others applications with both, interceptors and ngx-translate, and they works, the only diference is angular version (7 working, 8 not working)
Someone has any clue?
Thanks!
Have you tried changing the order in which interceptors are provided? Just a guess. Sometimes the little things do the trick.
High criticality!
I do have a feeling that the issue has something to do with the interceptor problem that started appearing with ngx-translate and Angular 8. There are multiple issues open about this, but this is the one that fixed my problem: https://github.com/ngx-translate/core/issues/921
Can you please check if the workaround from that issue fixes your problem as well?
Thank you, for me that solved my problem.
I got the same error in my angular application (and #921 did not solve it). In my case, the error was in my http-interceptor. I did some error-handling in catchError(...), and accidentally returned undefined in some cases.
@Injectable()
export class HttpErrorInterceptor implements HttpInterceptor {
intercept(
request: HttpRequest<any>,
next: HttpHandler
): Observable<HttpEvent<any>> {
const timestamp = Date.now();
return next.handle(request).pipe(
timeout(HTTP_TIMEOUT_MS),
retry(1),
catchError((error: any) => {
// pseude code ->
if (error instanceOf SomeError) {
return throwError(error);
}
// for errors that are not instanceOf SomeError
// undefined was returned!!!
})
);
}
}
any help about this issue ?
I can't find any help about issue :(
Hi @trantoi99 this issue normally occurs when 1) lost the internet connection, 2) the API does not respond or 3) the HTTP method is wrong.
Hi @trantoi99 this issue normally occurs when 1) lost the internet connection, 2) the API does not respond or 3) the HTTP method is wrong.
thank u so much
just throw error at the end.
return next.handle(req).pipe(
catchError((error: HttpErrorResponse) => {
if (error.status === 401) {
this._auth.logout();
return throwError(error); // <========== like this
} else if (error.status === 500) {
this._swalAlertService.error('Oopss! looks like server issue.');
return throwError(error); // <=========== like this
}
})
);
hi, in my case, I launched at local system with NestJS project, and there was no error but when I deployed at AWS EB it occurred with the same message!
nevertheless, i solved this problem with this approach. REMOVE THIS IN @Module decorator's providers item
import { APP_INTERCEPTOR } from '@nestjs/core';
{
provide: APP_INTERCEPTOR,
useClass: SkipInterceptor,
}
i assumed that only one APP_INTERCEPTOR is safe. because another provider already loaded APP_INTERCEPTOR.
Hi!,
I'm trying to use the HttpLoader in an angular 8 project, I've followed all the steps in the guide and in this tutorial and i get allways the same error at the chrome console:
"ERROR TypeError: You provided 'undefined' where a stream was expected. You can provide an Observable, Promise, Array, or Iterable."
I think i'm using the correct version (11+ core and 4+ loader) for Angular 8, anyway here are my dependencies form package.josn:
And my app.module.ts:
I've searched in the issues, even google, but I've not found anything to solve my problem.
Thank you.