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) – mickmackusa Oct 29 '19 at 21:22
  • Yes it could be, but how do you remove that when using addStyleSheet? – Eoin Oct 29 '19 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? – mickmackusa Oct 29 '19 at 23:07
  • @mickmackusa yes too hasty, the problem still stands. – Eoin Nov 21 '19 at 15:42

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. – mickmackusa Oct 30 '19 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 '19 at 15:43
  • Yup, a typo. Thank you. – Eoin Nov 22 '19 at 22:45
  • @Sharky Thank you for correcting me. In this case you were right. Take care. Have a great weekend. – coderparlerpartager Nov 23 '19 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 '19 at 23:03
  • @Eoin Glad to help. Have a nice day. – coderparlerpartager Oct 29 '19 at 23:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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