Skip to content

Unable to locate stylesheet styles.<hash>.css after upgarding to Angular 17 #26574

@hillin

Description

@hillin

Command

build

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

Description

After upgrading to Angular 17(.0.5), ng build reports warning:

✔ Browser application bundle generation complete.
✔ Copying assets complete.
⠋ Generating index html...Unable to locate stylesheet: < output-path >\styles.531a032ac3e91589.css
✔ Index html generation complete.
✔ Service worker generation complete.

The path which was unable to locate does not exist, indeed, because it's the destination of the output bundled css file.
None of the chunk files are copied to the output folder, but they are successfully generated in the dist folder. Copying them manually into the output folder works.

ng serve could run the project without any problem.

Minimal Reproduction

I'm sorry but I can't create a minimal repro, and my project cannot be provided. I understand this may well be a configuration problem or an issue in my code, but I'm running out of options to debug this problem.

Exception or Error

No response

Your Environment

Angular CLI: 17.0.5
Node: 18.16.1
Package Manager: yarn 1.22.17
OS: win32 x64

Angular: 17.0.5
... animations, cli, common, compiler, compiler-cli, core, forms
... language-service, localize, platform-browser
... platform-browser-dynamic, router, service-worker

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1700.0
@angular-devkit/build-angular   17.0.5
@angular-devkit/core            17.0.0
@angular-devkit/schematics      17.0.5
@angular/cdk                    17.0.2
@angular/material               17.0.2
@schematics/angular             17.0.0
ng-packagr                      17.0.0
rxjs                            7.5.6
typescript                      5.2.2
zone.js                         0.14.2

Anything else relevant?

No response

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