The content is a blog post from MrRedPig, a coder, discussing an issue encountered in Magento 2 related to the deployment of static content and its impact on the layout due to MIME type errors. The post is structured as follows:
The first section introduces the blog and its menu options, including Home, Magento 2, Regular Expression, Code Snippets, About, Contact, My Photos, and Lovely Songs. This sets the context for the technical content that follows.
The main content of the post details a specific problem the author faced: a layout break in Magento 2 caused by the error message “Refused to apply style because its MIME type (‘text/html’) is not a supported stylesheet MIME type.” This issue occurred after deploying changes from a local environment to a staging environment set to production mode. The author describes the sequence of commands executed, which included upgrading the setup, compiling dependency injection, deploying static content, and flushing the cache.
Upon investigation, the author identifies the root cause: the static content deployment command (`php bin/magento s:s:d`) only deployed content for the default language (`en_US`), leaving other store languages (`en_AU`, `en_NZ`, etc.) without necessary static content, leading to the MIME type error.
The solution provided involves running the static content deployment command with additional parameters to include all required languages (`php bin/magento s:s:d en_AU en_GB en_NZ en_US`). After executing this command and flushing the cache, the site functioned normally. The author also notes that switching from developer mode to production mode automatically deploys static content for all languages, which could prevent similar issues.
Today I get issue Refused to apply style “because its MIME type (‘text/html’) is not a supported stylesheet MIME type” This issue come to me in case my staging set deploy mo…