Site CSS Asset Issues - Possible missing file content

Hi,

One of my customers is experiencing a strange issue on their site, whereby intermittently some of the styling on the site is lost.

When inspecting in devtools the classes are not shown against the elements in the styling tab, and when searching the theme.css file content in the Sources tab, the missing classes can’t be found. These are however present in published theme file.

What’s stranger is that the behaviour changes depending on the network you are connected to. For example, when tethered via mobile it works, whereas switching back to wifi it breaks. This is repeatable as long as you clear cache each time.

No changes have been made to the site. Also, you can preview any theme available going months back and the issue is present for all of them, even after clearing browser cache.

I’m wondering whether the different networks land you on a different CDN endpoint and perhaps a dodgy file is being served?

One thing I did notice was there were two entries for the theme.css file in the Sources tab, a minified file and a sourcemap:

And then the minified version:

On a working machine you do not see the minified version of the theme.css file there in the sources tab.

That “hidden-lap-and-up” is an example class that is used on the site, exists in theme.css in the published theme, but is not seen on a broken browser. Here you see the class against the nav component, but nothing shows in styles.

And yet here it is defined in the theme.css file:

We raised a ticket with the helpdesk but they advised the best place to raise this would be on here, so here we are :slightly_smiling_face:

Would really appreciate some assistance with this one. Any ideas?

Thanks!

Problem resolved!

Managed to do a compare against the CSS being installed on the browser and the theme file and found a few thousands lines missing in the middle. Turns out there was an invalid character half way through that was causing it.

Funny thing is that character is there going back 6 months plus of older theme versions so how this hasn’t been an issue to now and only effecting some browsers is a complete mystery.