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

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
Last Edit:5 years 11 months ago Post by SparksArts

Attachments:

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

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

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

Post by ntstore

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

Time to create page: 0.650 seconds