mirror of
https://github.com/lipis/flag-icons.git
synced 2026-04-26 17:35:54 +03:00
[GH-ISSUE #1298] @import scss file is not working in angular applications #592
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#592
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 @LeLunZ on GitHub (Oct 28, 2024).
Original GitHub issue: https://github.com/lipis/flag-icons/issues/1298
Importing the 'node_modules/flag-icons/sass/flag-icons.scss' in an scss file isn't working in newer angular applications with the esbuild bundler (which is now default).
When I do this in my
styles.scss:I get an error that the flag files can't be resolved:
Its possible to fix this by adding
$flag-icons-path: 'node_modules/flag-icons/flags';before the@import, but that wasn't needed in older webpack angular applications.just to clarify, importing it in the config with
styles: ["node_modules/flag-icons/sass/flag-icons.scss"]is working, but then its not possible to specify$flag-icons-included-countries.@LeLunZ commented on GitHub (Nov 8, 2024):
This is an issue in angular 17. I just upgraded to v18, and now it works.
@EnzoBorgesPereira commented on GitHub (Jan 10, 2025):
Hi @LeLunZ, I have the same problem with angular 19, have you found a solution? (it works on v18, I'm updating my project)
@LeLunZ commented on GitHub (Jan 10, 2025):
In my global styles scss I can currently do:
I don’t need anything else.
Before when I had the problem I could fix it by doing:
If one of these worked please let me know.
It could also be a problem with your angular builder. For me I still used the old webpack, and upgrading to esbuild helped a bit.
@EnzoBorgesPereira commented on GitHub (Jan 10, 2025):
I am still have the same issue, even after trying your solution. I suspect the problem might be related to Angular v19.
Here my SCSS file:
And here are the CLI errors:
@lipis commented on GitHub (Jan 16, 2025):
Can't do much for this issue.. sorry!