• This topic was closed earlier but it is NOT closed. The answer that it is a “Theme” problem doesn’t help solve the problem. We need WP to put out a meaningful error message so that, as developers, we know where to look. Just stating, “Failed to load dynamic styles” doesn’t really say much. WHICH “dynamic styles?” Then maybe we can find the problem.

Viewing 8 replies - 1 through 8 (of 8 total)
  • “Failed to load dynamic styles” is not an error that WordPress will ever generate. So the problem the error is describing, and the lack of detail in the error message, is not WordPress’s fault. This is likely why the topic was closed. The issue is not with WordPress, but with your theme or a plugin.

    • This reply was modified 7 years, 5 months ago by Jacob Peattie.
    Thread Starter lwoods

    (@lwoods)

    The error message is being generated by tinyMCE, which is delivered as a part of WordPress.

    @lwoods

    Edit: Please see this post on the issue: https://www.ads-software.com/support/topic/wordpress-4-8-editor-failed-to-load-content-css/page/3/#post-9221255

    Thread Starter lwoods

    (@lwoods)

    Just drop it. It’s there!

    wp-includes\js\tinymce\tinymce.min.js

    “…i=function(a,b){f(a,”Failed to load content css: “+b[0])},j=function(a){var…”

    I just tracked down the cause of a persistent “Failed to load content css:” error, where the file it supposedly failed to load was the editor-style.css file from a child theme folder. But, I am running the same theme and child theme on 10 different websites, and only one of them was issuing an error message, so it’s not a theme problem, though the site with the problem was the only site on a particular host. But, I have a testing server on which I can run copies of all ten websites, and they all worked fine on my testing server except for the same site.

    After reading https://www.ads-software.com/support/topic/read-this-first-wordpress-4-8-master-list/#post-9221234 I looked closely and discovered a typo in an @import() line of the editor-style.css file and fixed it. But the WordPress editor was still kept throwing the error, even when I totally eliminated the @import() line from the editor-style.css file. Naturally, I was doing what I thought were ‘hard refreshes’ when testing, but, if the editor-style.css file was present in my child theme, then the WordPress editor always issued the failure to load warning message, even if the editor-style.css file was totally blank. I even replaced all WordPress, theme, and child theme files on the bad site from a working site on my testing server, but still the warning persisted.

    Curiously, I could see from looking at the editor window that the editor appeared to be using styles from the file for which I was receiving the failure to load warning, which I verified by using an element inspector. I tweaked some of the styles, and reloaded the editor window to determine whether the editor was stuck using a cached version of editor-style.css, which it apparently was – none of my style tweaks showed up, even after a hard refresh.

    At this point I tried opening an edit window with Firefox instead of Chrome and did not get an error message. I went back to chrome, and confirmed that I was still seeing an error even after more hard refreshes.

    Apparently a hard refresh (control refresh) doesn’t force Chrome to reload css files, so I used ‘more tools’ – ‘Clear browsing data’ from chome’s menu to clear ‘Cached image and files.’ After doing that I no longer see a warning message using Chrome.

    The upshot is that if you have ever had a typo problem that caused the WordPress editor to issue a warning about failing to load a css file, the warning may be the result of a typo rather than the file actually failing to load from the server. Apparently Chrome aggressively caches css files, so just fixing typos will not correct the problem until you aggressively clear Chrome’s cache (or the cache of whatever web browser you are using…).

    This problem also affected me, on sites which had had no changes to plugins or themes in years. Without a better error message I don’t see how I can hunt this down. What changed in 4.8 to start spitting out this error?
    I’ve looked at my theme files, none of which have changed, and see no issues with any @import statements.

    I think the thing that changed is that WordPress now issues an error message – previously there would have been no message even when an editor-style.css file fails to load completely for some reason.

    The most likely case is that there is a minor error in your theme (or child theme if one is in use) which was not previously flagged, and which didn’t produce noticeable effects…

    We saw this error when stylesheet urls needed to be updated to https.

    Check your console if you are seeing the message.

    Example:
    Mixed Content: The page at ‘https://www.davisconstructors.com/wp-admin/post.php?post=2136&action=edit’ was loaded over HTTPS, but requested an insecure stylesheet ‘https://fonts.googleapis.com/css?family=Arbutus+Slab’. This request has been blocked; the content must be served over HTTPS.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘WordPress 4.8 editor “Failed to load content css – dynamic styles”’ is closed to new replies.