angularionic-frameworkionic4ionicons

Ionicons return 404 in Ionic4


I updated npm today, and noticed many Ionic icons from ionicons.com return 404 error. I've found a workaround (basically, modifying the angular.json file). I'm not very comfortable with this, as I fear running into the same problem (and others) every time I update, considering this file must have been automatically modified by the updates I did. How do I fix this?

enter image description here

Ionic Info

   Ionic CLI                     : 5.4.15 (%USER_HOME%\AppData\Roaming\npm\node_modules\ionic)
   Ionic Framework               : @ionic/angular 4.11.10
   @angular-devkit/build-angular : 0.801.3
   @angular-devkit/schematics    : 8.1.3
   @angular/cli                  : 8.1.3
   @ionic/angular-toolkit        : 2.1.2

Capacitor:

   Capacitor CLI   : 1.5.0
   @capacitor/core : 1.5.0

Utility:

   cordova-res : 0.9.0
   native-run  : 0.3.0

System:

   NodeJS : v12.14.1 (C:\Program Files\nodejs\node.exe)
   npm    : 6.13.6
   OS     : Windows 10

Solution

  • Actually what happened was I was using v5 icons in v4. The problem wasn't the npm update which I did. So I just decided to upgrade to v5.

    npm update -g cordova ionic
    npm install @ionic/angular@5.0.0-rc.3
    npm install @ionic/app-scripts@latest --save dev
    

    Also, I'll like to point out, the usual Ionicicons.com link now contains only v5 icons. There's a new Ionicons v4 link. Icons from there work on v3 and v4.