Magento 2.3.3 - using CSS Critical Path throws strange syntax in source code - how can we solve this?

magento.stackexchange https://magento.stackexchange.com/questions/301931

  •  06-04-2021
  •  | 
  •  

Question

Google Page Speed told us, that we have rendering blocking CSS.

Now we try to solve this with CSS Critical Path activated.

We have created a Critical.css file

We have integated the same in our Theme.

All works fine, we try which styles are important and which CSS can load later.

BUT now the source code coming from CSS Critical Path in general adds a weird dot, (like a ".") to the code between media="all" and onload...:

link rel="preload" as="style" media="all" . onload="this.onload=null;this.rel='stylesheet'"href="http:

See here as well.

enter image description here

When running validator.w3.org it says

Error: Attribute . not allowed on element link at this point.

and also

Warning: Attribute . is not serializable as XML 1.0.

So this funny dot (.) is there.

Does anyone of you experts have a clue why this is there and how we could get rid of it?

Any help is so appreciated.

Warm regards

No correct solution

OTHER TIPS

It is a bug in Magento, fixed in the new version 2.4 see here https://github.com/magento/magento2/pull/26764/commits/f9697f509ae09f5c9e0f0d7b1a2de7ed9a53fc16

Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top