Repository navigation
[Angular 17] Wrong sass variable resolution with fontawesome on first ng test run #26718
Description
Activity
- changed the title
[-][Angular 17] Wrong sass variable resolution with fontaweomse on first `ng test` run[/-][+][Angular 17] Wrong sass variable resolution with fontawesome on first `ng test` run[/+]on Dec 20, 2023 - addedfreq1: lowOnly reported by a handful of users who observe it rarelyOnly reported by a handful of users who observe it rarely
on Dec 20, 2023 same issue here...
same issue
Same issue with:
- Angular 17.3
- Mac OS X14.3
- flag-icons (https://github.com/lipis/flag-icons)
- $flag-icons-path variable
Error:
Can't resolve '../../../../node_modules/flag-icons/sass/flag-icons/flags/4x3/tl.svg'
I'm seeing this same issue with Angular 18 and Font-Awesome 4 and Bootstrap 3. Any fix or workaround would be greatly appreciated.
I'm seeing this same issue with Angular 18 and Font-Awesome 4 and Bootstrap 3. Any fix or workaround would be greatly appreciated.
My workaround is, that I have two variable path files (folders), one for esbuild and the other for webpack, then I include the desired variable path file (folder) via
includePathsinangular.json.Thanks for reporting this issue. Luckily, it has already been fixed in one of the recent releases. Please update to the most recent version to resolve the problem.
If the problem persists in your application after upgrading, please open a new issue, provide a simple repository reproducing the problem, and describe the difference between the expected and current behavior. You can use
ng new repro-appto create a new project where you reproduce the problem.angular-automatic-lock-bot commented
on Nov 17, 2025 More actionsThis issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.
- locked and limited conversation to collaborators
on Nov 17, 2025
Command
test
Is this a regression?
The previous version in which this bug was not present was
16.x
Description
The first time I run
ng testI get several errors related to invalid paths where$fa-font-pathseems to be resolved incorrectly as../node_modules/@fortawesome/fontawesome-free/scss/@fortawesome/fontawesome-free/webfonts/fa-brands-400.ttfwhereas the actual path is../node_modules/@fortawesome/fontawesome-free/webfonts/fa-brands-400.ttf.The error does not occur when running
ng testa second time. The app itself runs fine withng servewith styles and icons being displayed correctly.I'm not sure whether this is an error with Angular or somewhere in the chain of Karma, sass, post-css, fontawesome etc.
Minimal Reproduction
ng newwith scssng generate config karmanpm i @fortawesome/fontawesome-freestyles.scssng testException or Error
Your Environment
Anything else relevant?
OS: MacOS 13.6.2