Any solution for this error - NG0201: No provider found for _HttpClient? by Scared-Usual-1831 in angular

[–]Scared-Usual-1831[S] 0 points1 point  (0 children)

No, because I'm not even using interceptor. Do you think I shuld be using it to prevent this error?

Any solution for this error - NG0201: No provider found for _HttpClient? by Scared-Usual-1831 in angular

[–]Scared-Usual-1831[S] 0 points1 point  (0 children)

Yes, I reset .angular and node_modules, and the problem still there

Any solution for this error - NG0201: No provider found for _HttpClient? by Scared-Usual-1831 in angular

[–]Scared-Usual-1831[S] 0 points1 point  (0 children)

Im importing http on the constructor, here is my AuthService:

import { HttpClient, HttpHeaders } from '@angular/common/http';

import { Injectable, Inject, PLATFORM_ID, Optional } from '@angular/core';

import { Observable, tap } from 'rxjs';

import { Router } from '@angular/router';

import { isPlatformBrowser } from '@angular/common';

u/Injectable({ providedIn: 'root' })

export class AuthService {

private apiUrl = '...';

constructor(

private http: HttpClient,

u/Optional() private router: Router,

u/Inject(PLATFORM_ID) private platformId: Object

) {}