The files are loaded as so:

$document = JFactory::getDocument();

Some work that way, but these two in particular don't. Are there any variables I can add to my addStyleSheet or addScript to make it work?

  • 1
    Is this a matter of rel="stylesheet" getting in the way? stackoverflow.com/q/44657829/2943403 Are the paths correct? stackoverflow.com/q/45528748/2943403 (magento.stackexchange.com/a/274602) Oct 29, 2019 at 21:22
  • Yes it could be, but how do you remove that when using addStyleSheet?
    – Eoin
    Oct 29, 2019 at 23:04
  • 1
    I don't know. Can you, first, confirm that the files DO exist at the path supplied? Is your accepted answer perhaps too hasty? Did it resolve your issue or merely suggest how to continue working toward a resolution? Will it resolve future researchers' issues? Oct 29, 2019 at 23:07
  • @mickmackusa yes too hasty, the problem still stands.
    – Eoin
    Nov 21, 2019 at 15:42

2 Answers 2


This most likely means that you are adding non-existing assets. Their links generate a 404 page which is why you're getting the text/html MIME type instead of respective types for CSS/JS files.

  • This is my suspicion as well. Oct 30, 2019 at 8:41
  • It seems to me that all of the mismatched items are missing .css from the end of the file name.
    – Eoin
    Nov 21, 2019 at 15:43
  • Yup, a typo. Thank you.
    – Eoin
    Nov 22, 2019 at 22:45
  • @Sharky Thank you for correcting me. In this case you were right. Take care. Have a great weekend. Nov 23, 2019 at 5:35

This kind of error comes from what is known as CSP (Content Security Policy) configured on your web server. If you don't know what it is. Please contact your hosting provider. For any information you can read this article on MDN (Mozilla Developer Network)

Take care. Hope it helps.

  • This will be Admin Tools then which is setting this policy I think. Thank you.
    – Eoin
    Oct 29, 2019 at 23:03
  • @Eoin Glad to help. Have a nice day. Oct 29, 2019 at 23:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.