Read before updating: How to Update Kunena Templates - More detail

Refused to apply style because its MIME type ('text/html') is not supported

S Topic Author
New Member New Member
  • Posts: 2
  • Thanks: 1

Refused to apply style because its MIME type ('text/html') is not supported

6 years 8 months ago - 6 years 8 months ago
#15746
After updating NTS Kay to version 5.2.9 I see a PHP error in Chrome browser dev tools console trying to load the font-awesome CSS.

"Refused to apply style from ' www.ostriches.org/media/kunena/cache/nts...font-awesome.min.css ' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled."

It's trying to load an external file through an internal link but that doesn't work.

I have installed all current versions:
Joomla 3.9.3
Kunena 5.1.9
NTS Kay 5.2.9

The solution is to change the code in this file: [root]/components/com_kunena/templates/nts_kay/template.php at line 143:

$this->addStyleSheet(" maxcdn.bootstrapcdn.com/font-awesome/4.7...font-awesome.min.css ");
change to
$doc->addStyleSheet(" maxcdn.bootstrapcdn.com/font-awesome/4.7...font-awesome.min.css ");

This fix will be added in next version of NTS Kay.

Hope this helps others with this problem. Thanks Hung Pham for the solution!
Richard

Attachments:

Last edit: 6 years 8 months ago by SparksArts.
The following user(s) said Thank You: ntstore

Please Log in or Create an account to join the conversation.

ntstore's Avatar
Administrator Administrator
  • Posts: 1213
  • Thanks: 240

Re: Refused to apply style because its MIME type ('text/html') is not supported

6 years 8 months ago
#15751
Hi SparksArts,

Special thank you about bug report. We fixed your issue and improved some style for NTS Kay template. Please download the latest version and update to your site.

Best regards,
Hung Pham
Email: 9themestore@gmail.com
Twitter: @9themestore

Please Log in or Create an account to join the conversation.

Time to create page: 0.575 seconds