Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

4.0.0-rc.1 missing ion-icons (with updated webpack config) #17019

Closed
petrot opened this issue Jan 9, 2019 · 18 comments
Closed

4.0.0-rc.1 missing ion-icons (with updated webpack config) #17019

petrot opened this issue Jan 9, 2019 · 18 comments
Labels

Comments

@petrot
Copy link

petrot commented Jan 9, 2019

Bug Report

Ionic version:

[x] 4.x

Current behavior:

Icons are missing with the following new configuration:

{
  "glob": "**/*.svg",
  "input": "node_modules/ionicons/dist/ionicons/svg",
  "output": "./svg"
}

Expected behavior:
Icons are working

@ionitron-bot ionitron-bot bot added the triage label Jan 9, 2019
@manucorporat
Copy link
Contributor

can you send your angular.json?

@petrot
Copy link
Author

petrot commented Jan 9, 2019

{
  "$schema": "./node_modules/@angular-devkit/core/src/workspace/workspace-schema.json",
  "version": 1,
  "defaultProject": "app",
  "newProjectRoot": "projects",
  "projects": {
    "app": {
      "root": "",
      "sourceRoot": "src",
      "projectType": "application",
      "prefix": "app",
      "schematics": {},
      "architect": {
        "build": {
          "builder": "@angular-devkit/build-angular:browser",
          "options": {
            "outputPath": "www",
            "index": "src/index.html",
            "main": "src/main.ts",
            "polyfills": "src/polyfills.ts",
            "tsConfig": "src/tsconfig.app.json",
            "assets": [
              {
                "glob": "**/*",
                "input": "src/assets",
                "output": "assets"
              },
              {
                "glob": "**/*.svg",
                "input": "node_modules/ionicons/dist/ionicons/svg",
                "output": "./svg"
              }
            ],
            "styles": [
              {
                "input": "src/theme/variables.scss"
              },
              {
                "input": "src/global.scss"
              }
            ],
            "scripts": []
          },
          "configurations": {
            "production": {
              "fileReplacements": [
                {
                  "replace": "src/environments/environment.ts",
                  "with": "src/environments/environment.prod.ts"
                }
              ],
              "optimization": true,
              "outputHashing": "all",
              "sourceMap": false,
              "extractCss": true,
              "namedChunks": false,
              "aot": true,
              "extractLicenses": true,
              "vendorChunk": false,
              "buildOptimizer": true,
              "budgets": [
                {
                  "type": "initial",
                  "maximumWarning": "2mb",
                  "maximumError": "5mb"
                }
              ]
            },
            "ci": {
              "progress": false
            }
          }
        },
        "serve": {
          "builder": "@angular-devkit/build-angular:dev-server",
          "options": {
            "browserTarget": "app:build"
          },
          "configurations": {
            "production": {
              "browserTarget": "app:build:production"
            },
            "ci": {
              "progress": false
            }
          }
        },
        "extract-i18n": {
          "builder": "@angular-devkit/build-angular:extract-i18n",
          "options": {
            "browserTarget": "app:build"
          }
        },
        "test": {
          "builder": "@angular-devkit/build-angular:karma",
          "options": {
            "main": "src/test.ts",
            "polyfills": "src/polyfills.ts",
            "tsConfig": "src/tsconfig.spec.json",
            "karmaConfig": "src/karma.conf.js",
            "styles": [],
            "scripts": [],
            "assets": [
              {
                "glob": "favicon.ico",
                "input": "src/",
                "output": "/"
              },
              {
                "glob": "**/*",
                "input": "src/assets",
                "output": "/assets"
              }
            ]
          },
          "configurations": {
            "ci": {
              "progress": false,
              "watch": false
            }
          }
        },
        "lint": {
          "builder": "@angular-devkit/build-angular:tslint",
          "options": {
            "tsConfig": ["src/tsconfig.app.json", "src/tsconfig.spec.json"],
            "exclude": ["**/node_modules/**"]
          }
        },
        "ionic-cordova-build": {
          "builder": "@ionic/angular-toolkit:cordova-build",
          "options": {
            "browserTarget": "app:build"
          },
          "configurations": {
            "production": {
              "browserTarget": "app:build:production"
            }
          }
        },
        "ionic-cordova-serve": {
          "builder": "@ionic/angular-toolkit:cordova-serve",
          "options": {
            "cordovaBuildTarget": "app:ionic-cordova-build",
            "devServerTarget": "app:serve"
          },
          "configurations": {
            "production": {
              "cordovaBuildTarget": "app:ionic-cordova-build:production",
              "devServerTarget": "app:serve:production"
            }
          }
        }
      }
    },
    "app-e2e": {
      "root": "e2e/",
      "projectType": "application",
      "architect": {
        "e2e": {
          "builder": "@angular-devkit/build-angular:protractor",
          "options": {
            "protractorConfig": "e2e/protractor.conf.js",
            "devServerTarget": "app:serve"
          },
          "configurations": {
            "ci": {
              "devServerTarget": "app:serve:ci"
            }
          }
        },
        "lint": {
          "builder": "@angular-devkit/build-angular:tslint",
          "options": {
            "tsConfig": "e2e/tsconfig.e2e.json",
            "exclude": ["**/node_modules/**"]
          }
        }
      }
    }
  },
  "cli": {
    "defaultCollection": "@ionic/angular-toolkit"
  },
  "schematics": {
    "@ionic/angular-toolkit:component": {
      "styleext": "scss"
    },
    "@ionic/angular-toolkit:page": {
      "styleext": "scss"
    }
  }
}

@manucorporat
Copy link
Contributor

manucorporat commented Jan 9, 2019

Can you check if node_modules/ionicons/dist/ionicons/svg exists?
Can you check if www/svg is emitted?

I can't reproduce your issue.

Make sure you remove node_module, and npm i again

@petrot
Copy link
Author

petrot commented Jan 9, 2019

node_modules/ionicons/dist/ionicons/svg exist, but www/svg not emitted.

remove node_modules and run npm install again did'nt solve the problem :/

@petrot
Copy link
Author

petrot commented Jan 9, 2019

I deleted the www folder, then ran a fresh build. Now the svg folder exists on the www folder. When I run ionic serve, there is an error on the dev toolbar: zone.js:1050 GET http://localhost:8100/svg/md-settings.svg 404 (Not Found) and there are empty icons. But if I copy the svg url and paste it into the browser, the svg appears.

@aces-tm
Copy link

aces-tm commented Jan 9, 2019

It's the same for me. It seems when I open another page that some icons appear... it's weird.

@aces-tm
Copy link

aces-tm commented Jan 9, 2019

I cleared cache on Google Chrome and everything worked as expected!

@paulstelzer
Copy link
Contributor

Correct, you have to clear the cache first

@petrot
Copy link
Author

petrot commented Jan 9, 2019

@aces-tm thanks, worked for me :)

however I think it's necessarry to remove the www folder before a fresh build.

@paulstelzer
Copy link
Contributor

paulstelzer commented Jan 9, 2019

Let us summarize:

  1. Edit the angular.json like mentioned in the CHANGELOG.md
{
  "projects": {
    "app": {
      "architect": {
        "build": {
          "options": {
            "assets": [
              {
                "glob": "**/*",
                "input": "src/assets",
                "output": "assets"
              },
+             {
+               "glob": "**/*.svg",
+               "input": "node_modules/ionicons/dist/ionicons/svg",
+               "output": "./svg"
+             }
  1. (Optional) Delete www folder
  2. ng serve / ionic serve
  3. Clear browser cache

@aces-tm
Copy link

aces-tm commented Jan 9, 2019

I didn't delete www, just cleared cache...

@manucorporat
Copy link
Contributor

Damn, stupid cache! Closing issue! thanks everyone for figuring this out!

@elylucas
Copy link
Contributor

elylucas commented Jan 9, 2019

If you cleared your cache and its still not working, see if you have your dev tools open. If so, click the 'disable cache' in there on the network tab and try again. This was the trick for me.

@john-md86
Copy link

Clear cache not work for me.

@elylucas
Copy link
Contributor

@jmdmao if you look in another browser that you haven't used before, do they still not show up? That should let you know if its a cache problem or something else.

@john-md86
Copy link

@jmdmao if you look in another browser that you haven't used before, do they still not show up? That should let you know if its a cache problem or something else.

works based on this suggestion:
#17084 (comment)

@peterennis
Copy link
Contributor

@paulstelzer
Delete www folder fixed it for me.
Thanks!

@ionitron-bot
Copy link

ionitron-bot bot commented Feb 16, 2019

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.

@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Feb 16, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

7 participants