Support » Plugin: AMP » CSS doesn’t generate

  • Resolved cosmins

    (@cosmins)


    Hi guys,
    All of a sudden, CSS doesn’t seem to be generated anymore inside the <amp-custom> tag, cleared all cache & transients.
    We do have also a staging environment with the same setup – same plugins (& versions), same theme and there everything is working properly.

    What could be the cause? What should I be looking into? Please help.

    The page I need help with: [log in to see the link]

Viewing 11 replies - 1 through 11 (of 11 total)
  • Plugin Author Weston Ruter

    (@westonruter)

    Are there any validation errors showing up when you click “Validate” under the AMP admin bar item? It may be due to having excessive CSS?

    selu

    (@marius2012)

    Hey @westonruter,

    I’m following up on the same site which my colleague reported.
    It’s some kind of inconsistency:

    Viewing the AMP page, https://www.codeinwp.com/blog/?amp, I see the CSS usage at 1% -> https://share.getcloudapp.com/L1upGm57 but when reviewing the validation details for that page, I see Total CSS size after minification: 41,922 B -> https://share.getcloudapp.com/8Lu7G8wN

    Any idea what could be causing this discrepancy?

    We are not using Object Cache, the generated CSS is stored in transients.

    Plugin Author Weston Ruter

    (@westonruter)

    Please share your Site Health info. Perhaps there is a plugin conflict?

    selu

    (@marius2012)

    Hi,

    I’ve attached the health info

    https://gist.github.com/selul/7659e846243552f4b4f58089f878d860

    We haven’t been able to isolate any conflict!
    Except for transients, is there any other place that could store the CSS generated?

    Plugin Author Weston Ruter

    (@westonruter)

    That’s strange. Are there any validation errors being reported for the CSS? You shared a screenshot of the stylesheet summary, but what about the table above?

    Plugin Author Weston Ruter

    (@westonruter)

    I bet you have a CSS rule that contains i-amphtml- somewhere.

    Plugin Author Weston Ruter

    (@westonruter)

    Actually, if that were the case then I’d expect the style[amp-custom] element to be removed entirely. See https://github.com/ampproject/amp-wp/issues/771

    For some reason it seems the stylesheets loaded via in link elements are getting dropped, but I don’t know why would be.

    Examining any validation errors that are being reported above the stylesheets metabox is the next place to look.

    selu

    (@marius2012)

    Hi @westonruter,

    All the validation errors reported by AMP on that page are JS related which has the markup status Removed, nothing related to the CSS.

    Any idea what could prevent the fetching of the external CSS files?

    selu

    (@marius2012)

    Hi @westonruter,

    I’m following up on this issue, it seems it was a CDN compatibility issue.

    Right now everything is ok.

    Plugin Author Weston Ruter

    (@westonruter)

    Please share the details about what the CDN compatibility issue was so that others in the future can benefit.

    selu

    (@marius2012)

    Hi @westonruter,

    I wish I could but I’m not sure what was causing this and the hosting company that we use doesn’t offer too many details around this. Basically this is their answer:

    We are aware that there are at times issues with our CDN, and have included a note about when you go to activate it:
    Kinsta CDN may not be 100% compatible with multisites and custom setups.
    There are often cases (due to a customized setup) where it is necessary to disable/re-enable the CDN cache to fix certain layout issues

    Based on your feedback regarding a possible issue with fetching of the external CSS styles, I have reported that would be an issue with the CDN and they have recreated the CDN distribution which magically fixed the problem.

    I hope this helps!

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘CSS doesn’t generate’ is closed to new replies.