felip gonzalez
felip gonzalez

Reputation: 11

ERROR in The target entry-point "ngx-cookie-service" has missing dependencies: in Angular 10.1.2

I am making a change from local storage to ngx-cookie-service but when running the platform I get the error: ERROR in The target entry-point "ngx-cookie-service" has missing dependencies:

My app.module.ts

import { CookieService } from 'ngx-cookie-service';

@NgModule({
  ...
  providers: [ CookieService ],
  ...
})
export class AppModule { }

CookieService

import { CookieService } from 'ngx-cookie-service';

@Injectable({
  providedIn: 'root'
})
export class Service {

  private userSubject: BehaviorSubject<User>;
  private user: Observable<User>;
  
  constructor(private cookieService: CookieService) {
    this.userSubject = new BehaviorSubject<User>(JSON.parse(this.cookieService.get('USER')));
    this.user = this.userSubject.asObservable();
  }

Upvotes: 1

Views: 601

Answers (1)

PV_Narayanan
PV_Narayanan

Reputation: 1

Found a possible solution in this thread here.

https://github.com/salemdar/ngx-cookie/issues/106#issuecomment-598242367

I had the same issue and updated the ngx-cookie-service package from my current version 12.0.0 to 14.0.0. Seems to have fixed it.

Upvotes: 0

Related Questions