Search code examples
angularpush-notificationangular-service-worker

@angular/service-worker/src/module.d.ts (30,9): Type 'ModuleWithProviders' is not generic


this errro occure from serveiceWorker node_moduleI have implemented "angular-push-notifications" in angular-4 using this link:

https://blog.angular-university.io/angular-push-notifications/

I have done set-up "Service Workers" in the following way

1. add this package npm i -S @angular/pwa
2. enable service-worker in .angular-cli.json
"apps": [
    {
      "root": "src",
      "outDir": "dist",
      "environmentSource": "environments/environment.ts",
      "environments": {
        "dev": "environments/environment.ts",
        "prod": "environments/environment.prod.ts"
      },
      "serviceWorker": true
    }

and then start my server using npm start, and the server will throw me this error

ERROR in ./node_modules/@angular/service-worker/src/module.d.ts (30,9): Type 'ModuleWithProviders' is not generic.

I don't understand what I need to do in this case.

please help me to short out this error.

thank you in advance


Solution

  • I have removed the Service Workers module and remove package angular-push-notifications in angular-4

    and use custom push notification using socket.io with my database, I have set the logic when new record added in the DB, I have notified the user using custom notification