Skip to content
This repository has been archived by the owner on Oct 25, 2024. It is now read-only.

Unexpected Warning: rules skipped due to selector errors #74

Closed
erictor opened this issue May 24, 2021 · 4 comments
Closed

Unexpected Warning: rules skipped due to selector errors #74

erictor opened this issue May 24, 2021 · 4 comments
Labels
bug Something isn't working has fix

Comments

@erictor
Copy link

erictor commented May 24, 2021

I opened up issue #20906 this in the angular-cli project and @alan-agius4 explained the following:

The root cause seems to be a bug in Critters which doesn't handle properly the @import.

Accordingly the issue I Opened has been Closed.

A similar issue, #20839 was Opened and has since been Closed.
Issue #42243 was Opened and was Closed as a duplicate of the issue I had opened.

Description:

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;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap');

Warning Text Displaying in Chrome Dev Tools:

1 rules skipped due to selector errors
0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap');

I validated at fonts.google.com that the import is composed correctly. The error is specifically pointing after family=Roboto:ital,wght@0,100; to "0,300;" (and beyond).

The Warning displays upon initial view in browser and each time the browser is refreshed.

@elawady55
Copy link

I have the same problem and the issue opened for 29 days, anyone track it?

@erictor
Copy link
Author

erictor commented Jun 22, 2021

A related Bug Report was opened #20975. It was Closed with the note that further tracking of that Bug would be done along with #20760.

@developit
Copy link
Collaborator

This should be fixed by #80 or #82.

@developit developit added has fix bug Something isn't working labels Oct 21, 2021
@developit
Copy link
Collaborator

I can confirm this is fixed in [email protected]+:

import Critters from 'critters';

const critters = new Critters();
critters.readFile = f => assets[f];
const assets = {
  '/x.css': `
    @import url('https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap');
    .foo{ color:red; }
  `
};

const html = await critters.process(`<div class="foo">hi</div><link rel="stylesheet" href="/x.css">`);

console.log(html);
"... <div class="foo">hi</div><style>@import url('https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap');.foo{color:red}</style>  ..."

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working has fix
Projects
None yet
Development

No branches or pull requests

3 participants