mirror of
https://github.com/lipis/flag-icons.git
synced 2026-04-26 09:25:50 +03:00
[GH-ISSUE #706] Only 1x1 ration showing... #370
Labels
No labels
3rd-party
3rd-party
bug
code
documentation
enhancement
fixed-in-master
flag-request
help needed
missing-flag
missing-flag
pull-request
wrong-flag
wrong-flag
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/flag-icons#370
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Spiff77 on GitHub (Apr 19, 2020).
Original GitHub issue: https://github.com/lipis/flag-icons/issues/706
Hello, I only have the 1x1 flag appearing... Am I doing wrong? I am using angular 9:


<span *ngFor="let lang of languages" (click)="frame.show()" class="flag-icon flag-icon-{{lang.isocode}}"></span>I installed using standard npm install
Thanks.
UPDATE
I replaced the pics from the 3x4 folder into the 1x1 folder and now it work.. i have no idea why it charge the wrong folder....
@Spiff77 commented on GitHub (Apr 20, 2020):
this is what is generated for in my in the inspector( AD for example)
.flag-icon-ad { background-image: url('ad.svg'); } .flag-icon-ad.flag-icon-squared { background-image: url('ad.svg'); }@Findus23 commented on GitHub (Apr 20, 2020):
Very random guess:
Do you use something like webpack and have it set up to e.g. store all assets in one directory like
/filename.extension?hash=something?Then you might be overwriting the 3x4 files with the 1x1 files on build as they have the same filename.
@Spiff77 commented on GitHub (Apr 20, 2020):
@Findus23 Thanks for you answer, the thing is I am not doing anything special: Angular 9 standard conf and material design. the only thing I have is the angular.json...
@ghost commented on GitHub (Apr 23, 2020):
Did you inspect the flag item to see the computed properties?
I suppose there is strange behavior on background-size property.
I'm using ^3.4.6 version together Angular 9 and no special issues to report.
@Spiff77 commented on GitHub (Apr 25, 2020):
Not a background property problem.. i try to deploy; all the ico are in the root folder :/
@ghost commented on GitHub (Apr 27, 2020):
Very strange behavior; could you put a sample on plunker?
@codevladimir commented on GitHub (May 2, 2020):
This is something that also happens to me. Using
"@angular/core": "~9.1.3"it gives the 1x1.An example of the styles with the inspect element
I didn't add any custom style.
@ghost commented on GitHub (May 5, 2020):
If you are able to reproduce the issue with "@angular/core": "~9.1.3" you can create an empty project with a flag-icon-css package and sample.
Thank you.
@Spiff77 commented on GitHub (May 7, 2020):
Just deployed it, it's not a problem after a build...
@codevladimir commented on GitHub (May 9, 2020):
I am using ubuntu. I didn't tried to build the project and see if it's somehow fixed, but while it is on serve, it is still showing as 1x1
@Spiff77 commented on GitHub (May 12, 2020):
@codevladimir Osx Here.
Anyway, would recommend not really taking care of it during dev since it work on deployment. you can replace put the content of 4X3 into 1X1 folder if you need to do css adjustments meawhile
@ssougnez commented on GitHub (Jun 29, 2020):
Hi, I had the same issue and the problem comes from the fact that the structure of the icons is not kept during the compilation. "flags/1x1/ru.svg" and "flags/4x3/ru.svg" will both fo into the "dist" directory. The difference between dev and prod mode is that prod mode adds an hash to the filename, so there will be a "ru.foo.svg" and a "ru.bar.svg" while in dev it will be "ru.svg" for both and therefore, the second (so the 1x1, because is appears in second in the CSS) will override the first one.
So indeed, this issue only occurs in dev mode and has noting to do with this library :-) Can be closed in my opinion.
Cheers
@KingDarBoja commented on GitHub (Jul 3, 2020):
Facing same issue but already read several SO posts regarding the problem and possible fix. As long as it is only in dev mode, it is okay I guess.
@bytelabsco commented on GitHub (Jul 10, 2020):
Was having the same issue, and these comments led me to this solution when using this library with Angular during development (ng serve).
Add the following to your angular.json file under projects -> {{your project}} -> architect -> build -> options:
"outputHashing": "all"and that should create the correct file hashes, which will give you separate 3x4 and 1x1 images.
@BeMacized commented on GitHub (Dec 27, 2020):
I'm still running into this issue with Angular 11.0 when running in development mode, even when setting
"outputHashing": "all".Not sure if it was possible on earlier versions, but with 11.0 setting this option seems to be useless when running in dev mode:
I added the following script to my package json as a workaround:
It works, but I wouldn't really call it a solution.