Skip to content

No compilation errors for non-existing css files referred in component's styleUrl/styleUrls #29887

@sd-git

Description

@sd-git

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

Don't known / other

Is this a regression?

Yes

Description

When using @angular-devkit/build-angular:application in new Angular there seems to be no check for existence of css files referred from the component.

To replicate, create empty project using the latest Angular, then edit src/app/app.component.ts and change .css file path to non-existing file or any string.

After that both ng serve and ng build still run successfully without any complains/warnings.

Unit tests ng test is failing (probably because it's still using webpack)

Please provide a link to a minimal reproduction of the bug

No response

Please provide the exception or error you saw


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

Angular CLI: 19.2.3
Node: 18.20.6
Package Manager: npm 10.8.2
OS: linux x64

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

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1902.3
@angular-devkit/build-angular   19.2.3
@angular-devkit/core            19.2.3
@angular-devkit/schematics      19.2.3
@angular/cli                    19.2.3
@schematics/angular             19.2.3
rxjs                            7.8.2
typescript                      5.7.3
zone.js                         0.15.0

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions