content_for_header is triggering unused render-blocking stylesheet
Link to Shopify Store
Reproduction steps
Just loading any page on my website and checking the source code shows that this render-blocking link is triggering inside of content_for_checkout:
I have commented out any instances of {{ form | payment_button }} and additional CSS in my theme that was modifying the dynamic checkout buttons.
No matter what I do, the stylesheet still renders and blocks render for 480ms on nearly all pages. It seems utterly ridiculous that this should be slowing down pages where dynamic checkout buttons aren’t being used.
Am I missing something here? Any help would be appreciated!
Those rules (#shopify-buyer-consent and #shopify-subscription-policy-button) relate to the subscription/selling-plan consent UI, and Shopify injects them via content_for_header. So commenting out payment_button won’t remove them, and editing content_for_header output isn’t supported. To narrow it down, check whether the store has any selling plans or a subscription app installed, then compare against a fresh Horizon/Dawn dev store to see whether it’s injected for every store or only yours. It’s also worth checking whether the 480ms is a lab Lighthouse figure or shows up in your real-user Core Web Vitals, as a tiny stylesheet served from the same origin often costs far less in the field. If it reproduces on a clean store, I’d file it as a platform bug with those comparisons.
Thanks @Tom, we have no subscription apps (and none that would create selling plans) and a fresh install of Horizon has the exact same issue. See screenshots attached.
I’m also running this through Shopify support at the moment so if I get any update from them I’ll post it here. They tried to blame BrickSpaceLab but I’ve pushed back because I’ve seen it on various themes (not just on Space).
In terms of real-user Core Web Vitals: we’re too new to even have any data for this yet on PageSpeed Insights. Are there any other ways of obtaining this prior to Google reporting it there?