# Adding @angular/pwa issue

**URL:** <https://forum.ionicframework.com/t/adding-angular-pwa-issue/139010>\
**Category:** Ionic Framework\
**Created:** [August 20, 2018, 10:25am UTC](https://forum.ionicframework.com/t/adding-angular-pwa-issue/139010 "2018-08-20T10:25:55Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![HinderiksR](https://avatars.discourse-cdn.com/v4/letter/h/9dc877/32.png) [@HinderiksR](https://forum.ionicframework.com/u/HinderiksR)\
**Post date:** [August 20, 2018, 10:25am UTC](https://forum.ionicframework.com/t/adding-angular-pwa-issue/139010/1 "2018-08-20T10:25:55Z")

</div>

Hi, i’m following a josh morony tutorial about adding service workers to your ionic 4 app: [https://www.joshmorony.com/create-a-pwa-with-angular-service-workers-in-ionic-4/](https://www.joshmorony.com/create-a-pwa-with-angular-service-workers-in-ionic-4/)

On of the first steps is to execute: ng add @angular/pwa --project \< app-name \>

However this results in the following error:

![49](https://global.discourse-cdn.com/ionicframework/original/3X/5/f/5f8879070a432c2ff92411f88c8068345072d596.png)

i’ve tried googling this but i cant seem to find a similar issue.

my node version is 8.11.4  
angular version : 6.0.9  
ionic version 4.0.0-beta.2

Any help would be appreciated

---

<div class="post-metadata">

**Author:** ![reedrichards](https://avatars.discourse-cdn.com/v4/letter/r/34f0e0/32.png) [@reedrichards](https://forum.ionicframework.com/u/reedrichards)\
**Post date:** [August 20, 2018, 11:09am UTC](https://forum.ionicframework.com/t/adding-angular-pwa-issue/139010/2 "2018-08-20T11:09:23Z")

</div>

- not sure, but, is maybe your global angular cli outdated?

- or maybe somewhere a node version problem?

---

<div class="post-metadata">

**Author:** ![HinderiksR](https://avatars.discourse-cdn.com/v4/letter/h/9dc877/32.png) [@HinderiksR](https://forum.ionicframework.com/u/HinderiksR)\
**Post date:** [August 20, 2018, 11:14am UTC](https://forum.ionicframework.com/t/adding-angular-pwa-issue/139010/3 "2018-08-20T11:14:34Z")

</div>

Fixed it by installing @angular/cli@latest. It seems it was using the outdated version angular-cli.

However running the command now throws a **Invalid rule result: Function().**.

it did however add the angular/pwa package on version 0.7.4. Somehow i expected this to line up with the other versions ie. 6.0.9

---

<div class="post-metadata">

**Author:** ![reedrichards](https://avatars.discourse-cdn.com/v4/letter/r/34f0e0/32.png) [@reedrichards](https://forum.ionicframework.com/u/reedrichards)\
**Post date:** [August 20, 2018, 11:26am UTC](https://forum.ionicframework.com/t/adding-angular-pwa-issue/139010/4 "2018-08-20T11:26:22Z")

</div>

> [@HinderiksR](#):
>
> However running the command now throws a **Invalid rule result: Function().**.

maybe there is an incompatibility since you installed the last pwa package and you are still using older angular libs…maybe try to upgrade angular dependencies?

---

<div class="post-metadata">

**Author:** ![HinderiksR](https://avatars.discourse-cdn.com/v4/letter/h/9dc877/32.png) [@HinderiksR](https://forum.ionicframework.com/u/HinderiksR)\
**Post date:** [August 20, 2018, 11:28am UTC](https://forum.ionicframework.com/t/adding-angular-pwa-issue/139010/5 "2018-08-20T11:28:22Z")

</div>

I found an open github issue regarding this error. Reverting to an older version of pwa seems to be the fix. How do you mean using older angular libs ?

---

<div class="post-metadata">

**Author:** ![AaronSterling](https://avatars.discourse-cdn.com/v4/letter/a/51bf81/32.png) [@AaronSterling](https://forum.ionicframework.com/u/AaronSterling)\
**Post date:** [August 20, 2018, 11:36am UTC](https://forum.ionicframework.com/t/adding-angular-pwa-issue/139010/6 "2018-08-20T11:36:56Z")

</div>

[https://www.npmjs.com/package/@angular/cli#updating-angular-cli](https://www.npmjs.com/package/@angular/cli#updating-angular-cli)

---

<div class="post-metadata">

**Author:** ![reedrichards](https://avatars.discourse-cdn.com/v4/letter/r/34f0e0/32.png) [@reedrichards](https://forum.ionicframework.com/u/reedrichards)\
**Post date:** [August 20, 2018, 11:39am UTC](https://forum.ionicframework.com/t/adding-angular-pwa-issue/139010/7 "2018-08-20T11:39:46Z")

</div>

```
"@angular/animations": "6.1.3",
"@angular/cdk": "6.4.5",
"@angular/common": "6.1.3",
"@angular/compiler": "6.1.3",
"@angular/core": "6.1.3",
"@angular/forms": "6.1.3",
"@angular/http": "6.1.3",
"@angular/material": "6.4.5",
"@angular/platform-browser": "6.1.3",
"@angular/platform-browser-dynamic": "6.1.3",
"@angular/platform-server": "6.1.3",
"@angular/pwa": "^0.7.4",
"@angular/router": "6.1.3",
etc.

```

P.S.: These are compatible respectively I don’t face that error, not in Ionic app but in my website

---

<div class="post-metadata">

**Author:** ![HinderiksR](https://avatars.discourse-cdn.com/v4/letter/h/9dc877/32.png) [@HinderiksR](https://forum.ionicframework.com/u/HinderiksR)\
**Post date:** [August 20, 2018, 11:57am UTC](https://forum.ionicframework.com/t/adding-angular-pwa-issue/139010/8 "2018-08-20T11:57:23Z")

</div>

It was indeed me having outdated angular version. I just got back from vacation and the dev team and i thought 6.0.9 was still the latest. Thanks.

---

<div class="post-metadata">

**Author:** ![reedrichards](https://avatars.discourse-cdn.com/v4/letter/r/34f0e0/32.png) [@reedrichards](https://forum.ionicframework.com/u/reedrichards)\
**Post date:** [August 20, 2018, 12:09pm UTC](https://forum.ionicframework.com/t/adding-angular-pwa-issue/139010/9 "2018-08-20T12:09:06Z")

</div>

Cool, nice to hear it worked out

P.S:: About dependencies version, [https://github.com/tjunnone/npm-check-updates](https://github.com/tjunnone/npm-check-updates) is awesome. I run the cmd `ncu` like every week to see what dependencies aren’t updated anymore, really handy

---

<div class="post-metadata">

**Author:** ![robinyo](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/robinyo/32/115964_2.png) [@robinyo](https://forum.ionicframework.com/u/robinyo)\
**Post date:** [August 21, 2018, 3:03am UTC](https://forum.ionicframework.com/t/adding-angular-pwa-issue/139010/10 "2018-08-21T03:03:03Z")

</div>

@HinderiksR

See:

- [Ionic 4 -\> ng add @angular/pwa](https://forum.ionicframework.com/t/ionic-4-ng-add-angular-pwa/138161)

---

<div class="post-metadata">

**Author:** ![mhartington](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/mhartington/32/137757_2.png) [@mhartington](https://forum.ionicframework.com/u/mhartington)\
**Post date:** [July 19, 2021, 9:22pm UTC](https://forum.ionicframework.com/t/adding-angular-pwa-issue/139010/11 "2021-07-19T21:22:58Z")

</div>


