1

I use Angular 7, I am trying to install ngx-cookie-service but get the warning above, and the error:

core.js:18374 ERROR Error: Uncaught (in promise): TypeError: Object(...) is not a function TypeError: Object(...) is not a function at Module../node_modules/ngx-cookie-service/fesm2015/ngx-cookie-service.js

my package.json

"dependencies": {
    "@agm/core": "^1.0.0",
    "@angular/animations": "^7.2.15",
    "@angular/cdk": "^7.3.7",
    "@angular/common": "~7.1.0",
    "@angular/compiler": "~7.1.0",
    "@angular/core": "~7.1.0",
    "@angular/forms": "~7.1.0",
    "@angular/material": "^7.3.7",
    "@angular/material-moment-adapter": "^8.2.3",
    "@angular/platform-browser": "~7.1.0",
    "@angular/platform-browser-dynamic": "~7.1.0",
    "@angular/router": "~7.1.0",
    "chart.js": "^2.9.3",
    "core-js": "^2.5.4",
    "file-saver": "^2.0.2",
    "hammerjs": "^2.0.8",
    "moment": "^2.24.0",
    "ngx-cookie-service": "^10.0.1",
    "ngx-google-places-autocomplete": "^2.0.4",
    "popper.js": "^1.16.1",
    "primeicons": "^1.0.0",
    "primeng": "^7.0.0",
    "rxjs": "~6.3.3",
    "tslib": "^1.9.0",
    "zone.js": "~0.8.26"
  },

when I tried to install ngx-cookie-service on an empty project it worked... but I don't find any solution for this one

Pavan Jadda
  • 4,306
  • 9
  • 47
  • 79
Miriam H
  • 31
  • 6
  • 1
    Since you're not using the latest version of ANgular (which is 10), did you have a look to `ngx-cookie-service` version compatibility ? You may have to specify a version of `ngx-cookie-service` to work with angular 7. – Random Aug 31 '20 at 07:32
  • I looked for it but didn't find how to control the version – Miriam H Sep 01 '20 at 08:15
  • 3
    On [the lib page](https://github.com/stevermeister/ngx-cookie-service) you can see "For versions <9, please use 2.3.0 version of library.". So you have to delete your node_modules, change your package.json : "ngx-cookie-service": "2.3.0", and then `npm install` (if you had not installed an other version yet, you could have simply do `npm install ngx-cookie-service@2.3.0`) – Random Sep 01 '20 at 09:16

0 Answers0