Unmatched selector: %
See original GitHub issueπ Bug report
Command (mark with an x
)
- new
- build
- serve
- test
- e2e
- generate
- add
- update
- lint
- extract-i18n
- run
- config
- help
- version
- doc
Is this a regression?
Yes, the previous version in which this bug was not present was: @angular-devkit/build-angular: 12.2.10Issue first appears with @angular-devkit/build-angular 12.2.11
Description
With 12.2.10 a production build there are no warnings. With 12.2.11 I am getting the following output (in fact my first build actually had over 200 such errors!). There is no easy way to track down the source CSS rule from the error message.
β Generating index html...2 rules skipped due to selector errors:
0% -> Unmatched selector: %
0% -> Unmatched selector: %
β Index html generation complete.
π¬ Minimal Reproduction
Add the following CSS to any application:
.demo {
background: red;
}
@keyframes demo {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(359deg);
}
}
π₯ Exception or Error
β Generating index html...2 rules skipped due to selector errors:
0% -> Unmatched selector: %
0% -> Unmatched selector: %
β Index html generation complete.
π Your Environment
Angular CLI: 12.2.10
Node: 14.17.2
Package Manager: npm 6.14.13
OS: win32 x64
Angular: 12.2.10
... animations, cli, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router
Package Version
------------------------------------------------------------
@angular-devkit/architect 0.1202.10
@angular-devkit/build-angular 12.2.11
@angular-devkit/core 12.2.10
@angular-devkit/schematics 12.2.10
@angular/cdk 12.2.9
@angular/material 12.2.9
@angular/material-moment-adapter 12.2.9
@schematics/angular 12.2.10
rxjs 6.6.7
typescript 4.3.5
Anything else relevant?
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:7
Top Results From Across the Web
Angular build - Unmatched selector: % - Stack Overflow
When I run npm run build which executes ng build -c production build will be completed as expected. But command prompt will be...
Read more >Unexpected Warning: rules skipped due to selector errors ...
In my styles.scss I have the following import as the first line: @import url('https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100;Β ...
Read more >Selectors Explained
Selectors Explained. Translate CSS selectors into plain English. Selector Explain β¨. Unmatched selector: \. Β© Made with by Kitty Giraudel Β· GitHub.
Read more >Angular 12 production build warning (MDB4 12)
Generating index html...8 rules skipped due to selector errors: .custom-file-input:lang(en)~.custom-file-label -> unmatched pseudo-class :langΒ ...
Read more >Detect Unmatched CSS Selectors with Helium
A great tool called Helium is available to help developers detect selectors in their stylesheets that are unmatched or malformed.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Alan,
Many many thanks for the very quick response - changing browserlist to your suggestion does indeed fix this issue.
(Aside: Iβve picked up support for this app and it hadnβt occurred to me review the browserlist !!! Iβm down to a handful of users stuck on IE11 so would have probably reviewed it once I had them shifted to a newer browser)
Thanks again, Neal.
The above browserslist configuration is rather permissive and a number of the resulting browsers are not supported which would also result in extra css prefixes and therefore increase in bundle size.
Can you try the below?