-
Notifications
You must be signed in to change notification settings - Fork 12k
Build warnings after migrating to Angular 12.0.0 for external .css files Unable to locate stylesheet
#20794
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Transferring to the CLI project for triage. |
Hi @jlquijada, It's not clear whether |
It is a remote url (external). I have also In any case, it is only a warning message during build, it gets loaded and it is used correctly during run time. This was working with version 9,10, and 11 of Angular. |
In this case the warning is mostly for information purposes. What this means, is that the mentioned css file will not be analysed for critical CSS inlining. |
The problem here is very simple: Files starting with http:// or https:// are external to the project and should not even be taken into account when making the package as they are not part of the projects' code. But in case you decide to parse those files, do not attempt to look for them on in index.html, this is wrongly processed: <link rel="stylesheet" href="https://some3rdpartydomain/somefile.min.css"> but this is correctly processed (or ignored as it is not relevant to building the package): <script type="module" src="https://some3rdpartydomain/somefile.js"></script> |
Unable to locate stylesheet
Previously, we tried to read remote stylesheets using `readFIle`. Related to angular/angular-cli#20794
Previously, we tried to read remote stylesheets using `readFile`. Related to angular/angular-cli#20794
Previously, we tried to read remote stylesheets using `readFile`. Related to angular/angular-cli#20794
Previously, we tried to read remote stylesheets using `readFile`. Related to angular/angular-cli#20794
I just came here to report the same thing. 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 // server.ts
ngExpressEngine({
bootstrap: AppServerModule,
inlineCriticalCss: false
}) As far as I see it is caused by var normalizedPath = href.replace(/^\//, '');
var pathPrefix = (publicPath || '').replace(/(^\/|\/$)/g, '') + '/';
if (normalizedPath.indexOf(pathPrefix) === 0) {
normalizedPath = normalizedPath.substring(pathPrefix.length).replace(/^\//, '');
}
var filename_1 = path.resolve(outputPath, normalizedPath);
var sheet_1;
var _temp5 = _catch(function () {
return Promise.resolve(_this3_1.readFile(filename_1)).then(function (_this3$readFile) {
sheet_1 = _this3$readFile;
});
}, |
Do we have any update on a fix for this issue? |
We are loading css files from a "local" path location at runtime. So css files will be there when properly deployed but are not part of the angular project. While in debug mode we are using a proxy to access the css files. Would be nice to have any simple option for exclusions. |
Previously, we tried to read remote stylesheets using `readFile`. Related to angular/angular-cli#20794
Previously, we tried to read remote stylesheets using `readFile`. Related to angular/angular-cli#20794 Co-authored-by: Jason Miller <developit@users.noreply.github.com>
….12` This change brings in a security fix causes was causes by an outdated dependency. See GoogleChromeLabs/critters#82 for more information. Also, remote stylesheets are excluded from processing, were previously this caused build failures. Closes #20794
….12` This change brings in a security fix causes was causes by an outdated dependency. See GoogleChromeLabs/critters#82 for more information. Also, remote stylesheets are excluded from processing, were previously this caused build failures. Closes #20794 (cherry picked from commit 9171fc0)
….12` This change brings in a security fix causes was causes by an outdated dependency. See GoogleChromeLabs/critters#82 for more information. Also, remote stylesheets are excluded from processing, were previously this caused build failures. Closes #20794
….12` This change brings in a security fix causes was causes by an outdated dependency. See GoogleChromeLabs/critters#82 for more information. Also, remote stylesheets are excluded from processing, were previously this caused build failures. Closes #20794
@filipesilva #21999 doesn't really close this. This also happens when deployUrl is set to a different path. |
@alan-agius4 please see above |
@maxisam, please file an issue with a reproduction thanks |
@alan-agius4 here is the repo https://github.com/maxisam/angular-13/tree/ssr-deploy-url I feel like it is the same issue causing by the same part of code like @lyczos mentioned. I can create one if you like. I don't understand why SSR needs to do inline critical css. I thought this is done in the build process. |
@maxisam, your issue is slightly different, see: angular/universal#2019. Note: |
@alan-agius4 Yeah, I just saw that on Angular 13. I didn't see that on 12. I will try to migrate it and see if it works |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
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
: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 section of my index.html
The application is correctly compiling otherwise, and runs correctly.
Thanks a lot for your attention.
The text was updated successfully, but these errors were encountered: