angular-material-extensions / select-country

Angular Material component that allow users to select a country or nationality with an autocomplete feature
https://angular-material-extensions.github.io/select-country/
MIT License
126 stars 40 forks source link

Error: Error retrieving icon :al! Http failure response for http://localhost:4200/assets/svg-country-flags/svg/al.svg: 404 Not Found #135

Open apangr opened 9 months ago

apangr commented 9 months ago

Describe the bug When initializing the component the flags do not load. I followed the steps in the documentation

imports:[
...
 MatSelectCountryModule.forRoot('en'),
...
]
 ..."assets": [
              "src/favicon.ico",
              "src/assets",
              "src/manifest.webmanifest",
              {
                "glob": "**/*",
                "input": "node_modules/svg-country-flags/svg",
                "output": "src/assets/svg-country-flags/svg"
              }
            ],...

Screenshots Screenshot from 2023-11-24 11-08-43

jezmaghuyop commented 8 months ago

@apangr having the same issue, I ended up manually copied the svg-country-flags/svg from node_modules to my assets folder.

sudarshansb143 commented 8 months ago

@jezmaghuyop Thanks for the workaround it works on angular 14

serox-rr commented 4 months ago

In angular 17 (maybe other versions), you just have to put ./assets/svg-country-flags/svg, instead of src/assets/svg-country-flags/svg, like this:

..."assets": [
              "src/favicon.ico",
              "src/assets",
              {
                "glob": "**/*",
                "input": "./node_modules/svg-country-flags/svg",
                "output": "./assets/svg-country-flags/svg"
              }
            ],...

Then It will work without copying the module.