Skip to content

Path declared in SCSS variable is incorrectly resolved #27007

Closed

Description

@piozygmunt

Command

build, serve

Is this a regression?

  • Yes, this behavior used to work in the previous version

The previous version in which this bug was not present was

16

Description

There seems to be a problem with resolving a path in scss/css when it's declared in SCSS variable. I prepared a simple repo here: https://github.com/piozygmunt/angular-scss . The crucial part is here https://github.com/piozygmunt/angular-scss/blob/master/src/app/scss/utils.scss .utils.css is file that is being imported into app.component.scss. Relative path from utils.scss to angular.png is ../../angular.png and when it is directly used inside url() function, it works. However if i define SCSS variable with the same path-value I'm getting error (path can't be resolved), also when it is changed to path relative to app.component.scss (../angular.png) it works again.

Is the new behaviour intentional?

Minimal Reproduction

https://github.com/piozygmunt/angular-scss

Exception or Error

No response

Your Environment

_                      _                 ____ _     ___
    / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
   / △ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
  / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
 /_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
                |___/
    

Angular CLI: 17.1.0
Node: 18.19.0
Package Manager: npm 10.2.3
OS: linux x64

Angular: 17.1.0
... animations, cli, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, router

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1701.0
@angular-devkit/build-angular   17.1.0
@angular-devkit/core            17.1.0
@angular-devkit/schematics      17.1.0
@schematics/angular             17.1.0
rxjs                            7.8.1
typescript                      5.2.2
zone.js                         0.14.3

Anything else relevant?

No response

Activity

  1. added
    freq1: low
    on Feb 1, 2024
  2. added 7 commits that reference this issue on Apr 11, 2024
    8535f95
    d30393d
    b254019
    daa6609
    1576335
    35e7187
    1b4b196
  3. added a commit that references this issue on Apr 12, 2024
    83d1d23
  4. angular-automatic-lock-bot commented on May 13, 2024

    @angular-automatic-lock-bot

    This 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.

  5. locked and limited conversation to collaborators on May 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions