angular / angular-cli

CLI tool for Angular
https://cli.angular.dev
MIT License
26.78k stars 11.98k forks source link

Build library: An error has occuried while processing (scss) #28937

Closed LuisTovar0 closed 8 hours ago

LuisTovar0 commented 9 hours ago

Which @angular/* package(s) are the source of the bug?

compiler

Is this a regression?

Yes

Description

With Angular 19, the library builder breaks if an SCSS file tries to import something (in this case a variable) from external modules or files, without explaining the error.

These two snippets are supposed to do the same, and produce the same error.

@use 'sass:map';
@use '../theming/theme';

p {
  background-color: #{map.get(theme.$primary, 98)};
}
@use 'sass:map';
@import '../theming/theme';

p {
  background-color: #{map.get($primary, 98)};
}

theme.scss:

$primary: (
  98: #f0f0f5,
);

Please provide a link to a minimal reproduction of the bug

https://stackblitz.com/edit/stackblitz-starters-yeykor?file=angular.json&view=editor

Please provide the exception or error you saw

An error has occuried while processing /home/projects/stackblitz-starters-yeykor/projects/my-lib/src/lib/my-comp.component.scss.

Please provide the environment you discovered this bug in (run ng version)

Angular CLI: 19.0.0
Node: 22.3.0
Package Manager: npm 10.8.1

Angular:
...

Package                      Version
------------------------------------------------------
@angular-devkit/architect    0.1900.0 (cli-only)
@angular-devkit/core         19.0.0 (cli-only)
@angular-devkit/schematics   19.0.0 (cli-only)
@schematics/angular          19.0.0 (cli-only)

Anything else?

No response