Support » Plugin: Autoptimize » Refused to apply style because its MIME type isn’t supported

  • Resolved thealonsotron

    (@thealonsotron)


    I’m having issues doing any edits/adding any CSS to my site without it breaking, and it’s currently yielding the following console error: “Refused to apply style from ‘https://robmalofilms.com/bridge/style.css’ because its MIME type (‘text/html’) is not a supported stylesheet MIME type, and strict MIME checking is enabled.”

    The only info I’ve been able to find is a possible conflict being caused by comments not being removed from minified CSS, but I’m honestly at a complete loss.

    Any help would be greatly appreciated.

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

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author Optimizing Matters

    (@optimizingmatters)

    Seems to work now @thealonsotron, but this typically happens when a CSS (or JS) file could not be loaded (404 not found), which has WordPress return the “not found”-page which indeed is HTML. Clearing any page cache you might have should solve that for you.

    hope this helps,
    frank

    Thread Starter thealonsotron

    (@thealonsotron)

    I’m still seeing the same error, and any attempts to modify CSS break the style entirely.

    Should I be disabling caching on Cloudflare’s end or something?

    Thread Starter thealonsotron

    (@thealonsotron)

    Quick followup, all possible caches are clear and I’m still getting that same error =/

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    OK, just saw that the “above the fold”-CSS is wrong @thealonsotron, it starts with;

    <style type="text/css" id="aoatfcss" media="all">@import url(../bridge/style.css);<style>.page-id-14869 .content>.content_inner>.full_width{background-color:#000}@media screen and (max-width:1000px){header{position:fixed!important;left:0!important;top:0!important}

    Which cannot work. Changing that into;
    <style type="text/css" id="aoatfcss" media="all">@import url(https://robmalofilms.com/wp-content/themes/bridge-child/../bridge/style.css);.page-id-14869 .content>.content_inner>.full_width{background-color:#000}@media screen and (max-width:1000px){header{position:fixed!important;left:0!important;top:0!important}

    will at least fix the error, but instead of importing the entire stylesheet you _should_ add the CSS in that file that applies to your above-the-fold page to the “above the fold”-CSS.

    hope this helps,
    frank

    Thread Starter thealonsotron

    (@thealonsotron)

    I’ll check my above-the-fold and see if that’s the culprit, thanks.

    • This reply was modified 1 year, 10 months ago by thealonsotron.
    Thread Starter thealonsotron

    (@thealonsotron)

    Yup this seems to have done it. I deactivated above-the-fold and that fixed the issue. I completely spaced and forgot to update it following some changes/major updates.

    Thank you.
    Now onto my parallax issue, hopefully I can solve that one faster.

    Thanks again, you’re the only one that was able to point this out. Everyone else was sending me to check the cache/talk to the host/some other dismissive response.

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    Happy it works now @thealonsotron, feel free to leave a review of the plugin and support here! đŸ™‚

    Thread Starter thealonsotron

    (@thealonsotron)

    Done and done đŸ˜‰ I kept forgetting to write a review, thanks!

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Refused to apply style because its MIME type isn’t supported’ is closed to new replies.