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

555 views Asked by At

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:

  • @ angular / core
  • @ angular / common

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();
  }
1

There are 1 answers

1
PV_Narayanan On

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.