1

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();
  }
Pavan Jadda
  • 4,306
  • 9
  • 47
  • 79

1 Answers1

0

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.

  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Jun 22 '22 at 04:40