57 questions
1
vote
1
answer
96
views
Error: Unexpected value 'StoreRootModule' imported by the module 'CoreModule'. Please add an @NgModule annotation
I updated my Angular version from 15 to 16. The compiler did not give any errors, but the browser console displayed this error:
core.module.ts
imports: [
CommonModule,
StoreModule.forRoot(...
1
vote
1
answer
103
views
Angular interceptor error handling put & delete method problem
I show an alert based on the http response returned in Angular. My code works in Get and post methods, but not in put and delete methods.I'm stuck here and would be very happy if someone could help me....
0
votes
1
answer
91
views
Angular - How to reload app after js/ts error?
Are there technologies or libraries capable of managing the refresh of an Angular app in case of typescript/javascript errors that can block the entire application? Is there a way to make the location....
0
votes
1
answer
1k
views
Retry http request with Angular Interceptor ONLY when user clicks a button
I'm using Angular HttpInterceptor to handle errors in my Http requests.
If there is an error other than 401, I am displaying a popup modal that contains 2 buttons ('Close' to close the modal and '...
0
votes
0
answers
61
views
Unable to check for error on the HTML DOM for Angular Reactive From CustomValidator
I am trying to create a custom validator for an Angular reactive form that checks for the existence of a username in a Firestore database. The validator is working as expected and returning the ...
2
votes
2
answers
4k
views
Some trouble with "catchError" angular function
I had an error
this is an error
So I am learning how to catch errors with the catchError function in angular htttp services
I have a ts file that executes function handler errors
import { Injectable } ...
4
votes
1
answer
2k
views
How to implement a global ErrorHandler along with an HttpInterceptor in Angular?
I found on the web that ErrorHandler can catch all errors as client-side errors and also httpErrorResponse errors.
But in my situation, I can catch only client-side errors in GlobalErrorHandlerService,...
0
votes
1
answer
390
views
How to prevent Angular interceptor from clean error code?
In my project I'm using Angular 15.
Inside I'm using two interceptors "HttpRequestInterceptor" and "ErrorInterceptor".
The HttpRequestInterceptor deletes the error status code and ...
0
votes
1
answer
1k
views
No provider for NgControl found in NodeInjector. how to get rid from this error?
I am facing this issue, I am searching a lot but nothing works.
Please suggest to me, how to solve this.
I have added this to the application module file.
import {FormsModule} from '@angular/forms' ...
2
votes
1
answer
1k
views
After call setErrors method in FormControl doesn't show inmediately (Angular Material)
When I call setErrors for a textbox FormControl instance as shown in the images below, there should be an error message immediately but I don't see it until I remove the entire text.
Here is my HTML ...
0
votes
1
answer
99
views
Cannot load the application in newer version without loading it in older version of Angular
I was working on angular 2 previously and now upgraded the application to angular 12, the application is loading but only if the version 2 is compiled and loaded. It is compiling successfully , but ...
0
votes
1
answer
346
views
Angular, ErrorHandler and BehaviorSubject: update message only second click
I am trying to implement a general http handler error, but I found a strager behavior. My Error component only update the message error only after second click, but I dont know why.
The code is ...
0
votes
1
answer
3k
views
How do I display a back-end error in the front-end in Angular?
I'm trying to display an error, generated by the back-end, in the front-end developed in Angular material. I want that the error message is displayed into an alert window. My problem is that the error ...
1
vote
1
answer
2k
views
Angular: multiple material snackbar in global ErrorHandler
I use in angular the following global ErrorHandler:
@Injectable()
export class GlobalErrorHandler implements ErrorHandler {
constructor(private errorService: ErrorService, private ...
1
vote
1
answer
1k
views
Dialog opened by custom ErrorHandler provider in response to async event does not close
I have a general Alert Dialog component that I use for various purposes throughout an Angular application (simplified)...
@Component({
selector: 'app-alert-dialog',
template: `<mat-dialog-...
2
votes
1
answer
1k
views
Is it possible to ignore some errors conditionally, in global error handler of Angular?
I have a situation where I call an API to save data both manually and automatically,
In the case of manual save I want to show the error if the save fails, and I achieved this using an angular global ...
1
vote
1
answer
847
views
Angular, Http Error blocks any further requests
After an error-response from the server my app does not send any further requests.
I'm sending a request with:
getMachineRules(rules: Array<string>): Observable<RulesResults> {
return ...
-1
votes
2
answers
547
views
ASSERTION ERROR: This TNode does not belong to this TView. after angular update from v7.1 to v11
I have updated the angular app from v7.1 to v11, Updation was successful but after the update getting the below error.
ERROR Error: ASSERTION ERROR: This TNode does not belong to this TView. [Expected=...
1
vote
0
answers
7k
views
How to use ToastrService to show Toastr notifications for server errors in Angular
I am using ToastrService to show notifications for server errors. But it does n't seems to be work. In the Ui if get request is not loading data to the tabular view due to a backed issue how to show ...
1
vote
1
answer
1k
views
How to handle server errors in Angular using Http Interceptors
I am trying to handle server errors coming from my backend in my Angular project. I am using angular HTTP Interceptors. This is my interceptor service class
@Injectable({
providedIn: 'root'
})
...
4
votes
2
answers
2k
views
catchError Not working when returning error 500 from web-api
After trying more complex scenarios, without solution I return to basics:
I have a web-api controller that when returning error 500, I would like the client to catch it.
For some reason - this isn't ...
2
votes
1
answer
2k
views
rxjs error subscription not being triggered
I have a .net Core web-api application.
I intentionally return an exception from the controller, but I don't see the exception being treated in the error treatment of the subscription.
This is my code ...
-2
votes
1
answer
55
views
i can´t use GlobalErrorHandler as Injectable(), and launch it when lazy funcion child Not Found?
problem
ERROR Error: Uncaught (in promise): Error: Loading chunk dashboard.module failed.
Error: Loading chunk dashboard.module failed.
i would like use this
import { Injectable, ErrorHandler } from &...
-3
votes
1
answer
162
views
Why I am getting error in Angular. can't GET /
I was facing the error can't GET / in Angular after implementing the Route.
1
vote
2
answers
4k
views
Angular get all console errors
I'm trying to catch all console errors of my Angular aplication, not only the http response error, but also those that are generated in the application. I mean, All console errors, like this
or like ...
1
vote
0
answers
183
views
How to send server error request when ever error happen in Angular application?
I have a global error Interceptor which handles the error when server return error response. I have error interceptor to handle that.
In my use case whenever an error occurs in angular app , consider ...
2
votes
1
answer
3k
views
Angular ErrorHandler and HttpErrorResponse
Today I have decided to look more into some centralized error reporting for my Angular application. I used great article on Medium by Michael Karén (https://medium.com/angular-in-depth/expecting-the-...
4
votes
0
answers
53
views
Silence ExpressionChanged in this particular use case? Not fixing the error but don't display it on the console, stackblitz inside
Related to my question here. and you can find the stackblitz here.
I understand why the error shows up and it is indeed correct the fact that it is showing up. Although this is a non-production use ...
0
votes
1
answer
2k
views
Angular 2 Toastr Not Working in Global Error Handler
I am trying to use ngx-toastr in my global error handler, but it is giving me the following error.
Error: Cannot instantiate cyclic dependency! ApplicationRef
at throwCyclicDependencyError (core.js:...
2
votes
0
answers
90
views
Angular - ErrorHandler vs HttpInterceptor
I would like to ask if there is any reason for using ErrorHandler and also HttpInterceptor when I want to show a specific error to end user?
My question motivation is - I have a project with Angular ...
2
votes
1
answer
459
views
Angular how to use HttpClient in custom ErrorHandler?
I would like to call my rest API in my custom error handler to email myself when the handler is called.
I have tried to use the Injector, but I get this error:
Error: Cannot instantiate cyclic ...
0
votes
2
answers
374
views
Why every time this error shows when I run ng serve my project?
error: No base href set. Please provide a value for the APP_BASE_HREF
token or add a base element to the document. at new
PathLocationStrategy (common.js:453) at provideLocationStrategy
(router....
0
votes
1
answer
793
views
Use Angular ErrorHandler and map error result
Our current situation is as described, we have a huge angular application where a lot off API calls are fired in various components with error-handling so error will be displayed to the user with a ...
0
votes
0
answers
146
views
User interface crashes after Sentry throws an error
I'm using Angular 7 and ngx-admin for a project. Also I'm using Sentry to log errors in a server. I have three level routes and the error occurs in the third level. When Sentry throws error the UI ...
0
votes
2
answers
69
views
errorHandle angular 7
How to manage error block in this situation - error managing in service and send to component
Here storing data in BehaviorSubject in the first load and subscribing data from where I need.
just ...
8
votes
2
answers
2k
views
How to limit scope of ErrorHandler?
I have a global error handler defined as such (simplified/proprietary info scrubbed):
export class ErrorsHandler extends CommonBase implements ErrorHandler {
constructor(protected loggingService: ...
4
votes
2
answers
12k
views
Remove error messages from browser console (Angular HttpClient)
Is there a way with the HttpClient to remove error messages from the browser console?
My current code looks like this:
getStuff(stuffId: string): Observable<Stuff[]> {
return this....
0
votes
1
answer
2k
views
Angular - ErrorHandler for interceptor for custom HTTP error handling
I had a clarification on usage of intercepting ErrorHandler for handling custom error for HTTP requests and client side errors in Angular 6+.
Its getting called correctly for client side errors. But ...
1
vote
0
answers
491
views
'Error: uncaught (in promise) missing number at position 0' in error handler in angular5
I am using ErrorHandler interface in my angular5 project to show the error message and log error in console. The problem is I am getting Error: uncaught (in promise): Missing number at position 0 and ...
1
vote
1
answer
1k
views
update component with custom error handling in angular 6
I'm using Angular 6.
I have created a custom Error Handler extending ErrorHandler to handle all network errors like.
import {ErrorHandler, Injectable, Injector} from '@angular/core';
import {...
0
votes
3
answers
4k
views
How to get body/content of request from the HttpErrorResponse? [Angular ErrorHandler]
Let's say I sent a post request to the server to create a user. If the server responds with an error, I want to get the body(form) I submitted(attached to that request) from the ErrorHandler. The ...
0
votes
0
answers
611
views
httpClient on error refreshes the url in Angular
I am trying to use httpClient in Angular to make API calls. Here is my code where I am making the api call.
This is my httpPost method in authService:
this.authService.httpPost("/api/Users/...
-1
votes
1
answer
921
views
can't display backend errors in component html - Angular
I'm trying to display the backend error that I generate with my errorHandler, but it's not showing anything.
How can I show it?
it returns undefined
HTML
//This triggers the observable, if it has ...
0
votes
2
answers
230
views
Angular ErrorHandler passed incorrect data
//api.service.ts
public Get(slug: string): Observable<T> {
return this.http.get(`${environment.apiBaseURL}/${this.endPoint}/${slug}`).pipe(
map(data => this.serializer.fromJson(...
0
votes
0
answers
2k
views
Issue in handling Http Response with status: 200 from an Angular 6
As I tried to upload an image via API scripted in PHP, once after uploading succeded into the following directory getting HttpErrorResponse code with status: 200
upload-image.component.ts
OnSubmit(...
3
votes
2
answers
8k
views
Angular routing exceptions handing in error handler
How to handle navigation errors in ErrorHandler?
I tried using the following condition to check whether Error object is of NavigationError but it says false.
export class AppErrorHandler implements ...
0
votes
1
answer
230
views
How to add a new component when Angular app fails to bootstrap
I have a question about my Angular app, I have an app that gets its initial config data from an API and can bootstrap the app using those config. Here is the ApiConfigService:
export class ...
4
votes
1
answer
911
views
Angular GlobalErrorHandler and HttpErrorResponse - Resolver throwing badly formatted HttpErrorResponse
I've created global error handler in my Angular 6 application:
main error handler method:
handleError(error: Error | HttpErrorResponse) {
const router = this.injector.get(Router);
const ...
5
votes
1
answer
4k
views
ErrorHandler & RxJS 6.2.2
I have an application with an globalError handler like this:
import { Injectable, ErrorHandler, Injector } from "@angular/core";
import { Router } from "@angular/router";
@Injectable()
export class ...
2
votes
2
answers
1k
views
Angular 5: Can HttpInterceptor Replace ErrorHandler
While reading through the Error Handling in Angular 5, I came across 2 ways: 1. HttpInterceptor and 2. ErrorHandler.
Is HttpInterceptor a better solution than ErrorHandler?
Can you have both ...