angular-cli: Build warnings after migrating to Angular 12.0.0 for external .css files `Unable to locate stylesheet`
Hi there!
After migrating my project to version 12.0.0, I get the following messages for external .css files when I issue the command ng build
:
- Generating index html…Unable to locate stylesheet: C:\myproject\ClientApp\dist\https:\somedomain\somefile.min.css
Also when running the command ng serve
, I get the corresponding warning messages for the same files.
The references (there are two such files) are in the <head> section of my index.html
<link rel="stylesheet" href="https://somedomain/somefile.min.css">
The application is correctly compiling otherwise, and runs correctly.
Thanks a lot for your attention.
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 5
- Comments: 16 (5 by maintainers)
Commits related to this issue
- fix: skip processing of remote stylesheets Previously, we tried to read remote stylesheets using `readFIle`. Related to https://github.com/angular/angular-cli/issues/20794 — committed to alan-agius4/critters by alan-agius4 3 years ago
- fix: skip processing of remote stylesheets Previously, we tried to read remote stylesheets using `readFile`. Related to https://github.com/angular/angular-cli/issues/20794 — committed to alan-agius4/critters by alan-agius4 3 years ago
- fix: skip processing of remote stylesheets Previously, we tried to read remote stylesheets using `readFile`. Related to https://github.com/angular/angular-cli/issues/20794 — committed to alan-agius4/critters by alan-agius4 3 years ago
- fix: skip processing of remote stylesheets Previously, we tried to read remote stylesheets using `readFile`. Related to https://github.com/angular/angular-cli/issues/20794 — committed to alan-agius4/critters by alan-agius4 3 years ago
- fix: skip processing of remote stylesheets Previously, we tried to read remote stylesheets using `readFile`. Related to angular/angular-cli#20794 — committed to alan-agius4/critters by alan-agius4 3 years ago
- fix: skip processing of remote stylesheets (#75) Previously, we tried to read remote stylesheets using `readFile`. Related to angular/angular-cli#20794 Co-authored-by: Jason Miller <developit@u... — committed to GoogleChromeLabs/critters by alan-agius4 3 years ago
- fix(@angular-devkit/build-angular): update `critters` to version `0.0.12` This change brings in a security fix causes was causes by an outdated dependency. See https://github.com/GoogleChromeLabs/cri... — committed to angular/angular-cli by alan-agius4 3 years ago
- fix(@angular-devkit/build-angular): update `critters` to version `0.0.12` This change brings in a security fix causes was causes by an outdated dependency. See https://github.com/GoogleChromeLabs/cri... — committed to angular/angular-cli by alan-agius4 3 years ago
- fix(@angular-devkit/build-angular): update `critters` to version `0.0.12` This change brings in a security fix causes was causes by an outdated dependency. See https://github.com/GoogleChromeLabs/cri... — committed to angular/angular-cli by alan-agius4 3 years ago
- fix(@angular-devkit/build-angular): update `critters` to version `0.0.12` This change brings in a security fix causes was causes by an outdated dependency. See https://github.com/GoogleChromeLabs/cri... — committed to angular/angular-cli by alan-agius4 3 years ago
I just came here to report the same thing. All of our projects refer tot he same set of global styles at our organization so we add the following to the index.html of each project
<link rel="stylesheet" type="text/css" href="https://internalcdn.com/Apps/CSS/StyleSheet.css">Now with Angular 12, we get this warning every time we build…
Unable to locate stylesheet: C:\dist\https:\internalcdn.com\Apps\CSS\StyleSheet.css
As @jlquijada stated, the resulting build is still correct and the site works as expected.
I’m having the same issue while using https://github.com/angular/universal Turning off
inlineCriticalCss
inngExpressEngine
options seems to work for me at least for SSR.As far as I see it is caused by
Critters:getCssAsset()
- it’s trying to resolve external assets (ex. from CDN) on local path@maxisam, your issue is slightly different, see: https://github.com/angular/universal/issues/2019.
Note:
deployUrl
is deprecated and is recommended to replace it withbaseHref
andAPP_BASE_HREF
instead.