No CSS on Log in Page

Just moved a site to Hostinger - never used this service before and I’m getting the following message…

The stylesheet https://tempdomain.hostingersite.com/manager/templates/default/css/login.css was not loaded because its MIME type, “text/html”, is not “text/css”.

What am I doing wrong?

Does the file manager/templates/default/css/login.css exist?
If so, then the server should return this file without MODX being involved at all.

Suddenly it does! This must be down to some sort of caching within Hostinger - it’s lagging behind. Currently .ccs files not loading for Image+ but everything else is.

There’s more to this than was at first apparent… I think it might have something to do with an external domain name that is somehow set up through GitLab - need to ask the client’s IT guy exactly what’s been set up…

assets/components/ace/modx.texteditor.js?mv=304pl” was loaded even though its MIME type (“text/html”) is not a valid JavaScript MIME type.

What is that…

mv=304pl

…on the end of everything?

It’s just a GET parameter with the MODX version. I believe the purpose of it is, that after a MODX upgrade, the browser will request these files from the server again and not used the ones from the browser cache (that might be outdated).

Thanks Harry - I’m wondering if upgrading to 3.0.5 might flush errors out or at least highlight what they are - in the meantime in the frontend I’m getting…

The script from “https://tempdomain.hostingersite.com/assets/minifyx/js/scripts_p7e17ed4835.min.js” was loaded even though its MIME type (“text/html”) is not a valid JavaScript MIME type.

and in the back end (browser console) I’m getting errors that are typically like this…

The script from “https://tempdomain.hostingersite.com/assets/components/ace/ace/ace.min.js?mv=304pl” was loaded even though its MIME type (“text/html”) is not a valid JavaScript MIME type.
manager
The script from “https://tempdomain.hostingersite.com/assets/components/ace/ace/ext-language_tools.js?mv=304pl” was loaded even though its MIME type (“text/html”) is not a valid JavaScript MIME type.
manager
The script from “https://tempdomain.hostingersite.com/assets/components/ace/ace/ext-keybinding_menu.js?mv=304pl” was loaded even though its MIME type (“text/html”) is not a valid JavaScript MIME type.
manager
The script from “https://tempdomain.hostingersite.com/assets/components/ace/ace/ext-emmet.js?mv=304pl” was loaded even though its MIME type (“text/html”) is not a valid JavaScript MIME type.
manager
The script from “https://tempdomain.hostingersite.com/assets/components/ace/modx.texteditor.js?mv=304pl” was loaded even though its MIME type (“text/html”) is not a valid JavaScript MIME type.
manager
The script from “https://tempdomain.hostingersite.com/assets/components/imageplus/js/mgr/imageplus.min.js?v=v2.9.4&mv=304pl” was loaded even though its MIME type (“text/html”) is not a valid JavaScript MIME type.
manager
The stylesheet https://tempdomain.hostingersite.com/assets/components/imageplus/css/mgr/imageplus.min.css?v=v2.9.4&mv=304pl was not loaded because its MIME type, “text/html”, is not “text/css”. manager
The stylesheet https://tempdomain.hostingersite.com/assets/components/collections/css/mgr.css was not loaded because its MIME type, “text/html”, is not “text/css”. manager
The stylesheet https://tempdomain.hostingersite.com/assets/components/upgrademodx/css/progress.css was not loaded because its MIME type, “text/html”, is not “text/css”.

So manager css now seems to be loading ok but not the CSS for extras.

If this is a “MODX” problem at all, then the issue is most likely your .htaccess file in the root folder.


So if you request one of these files directly in your browser, what is the response?

Blank page when requesting directly so I’ve stripped the htaccess back to just…

RewriteEngine On
RewriteBase /

…and components are now loading properly on the dashboard but when I go to a resource I get…

The stylesheet https://tempdomain.hostingersite.com/assets/components/tinymcerte/css/mgr/tinymcerte.css?v=2.0.9&mv=304pl was not loaded because its MIME type, “text/html”, is not “text/css”. manager


The stylesheet https://tempdomain.hostingersite.com/assets/components/tinymcerte/css/mgr/tinymcerte.css?v=2.0.9&mv=304pl was not loaded because its MIME type, “text/html”, is not “text/css”. manager


Uncaught TypeError: TinyMCERTE.loadForTVs is not a function
    <anonymous> https://tempdomain.hostingersite.com/manager/?a=resource/update&id=137:542
    ExtJS 9

What is the response in the browser when you call

https://tempdomain.hostingersite.com/assets/components/tinymcerte/css/mgr/tinymcerte.css?v=2.0.9&mv=304pl

directly?
Does it work if you remove ?v=2.0.9&mv=304pl at the end?
Does the file assets/components/tinymcerte/css/mgr/tinymcerte.css exist?


If this is the only content in your .htaccess file, then MODX isn’t involved at all in any requests to CSS or JS files.

Maybe try RewriteEngine Off or contact your hosting provider.

Thank you for your help Harry. That file does exist and it does display. In fact the resource pages all load now without error. I’ll start adding back into the htaccess file again and see what breaks it. It just seems as if there is a delay between making changes and anything actually happening.

This could be a problem (possibly an intermittent one) with the server configuration. It’s the server’s job to convey the mime type to the browser. It usually does this on the basis of the file extension, though if the file was created on a Mac, it may use a code place inside the file.

In your case, it sounds like the server is seeing a request for a CSS file, but seeing the file as html and deciding not to serve it up. I know very little about server configuration, but one would hope that the server could be configured to either let the file extension prevail in case of a conflict, or default to just serving the file when it’s confused rather than throwing that error.

Firstly - thank you Harry & Bob - your advice is always most welcome. I’ve had to get this site live quite quickly so not been able to investigate fully but I’m sure it was something to do with a gzip implementation I’d put in place in the .htaccess file. Once removed everything settled down. I’m not sure exactly what part caused it but perhaps connected to this in gzip.php…

// output the content-type header for each file type
	switch ($_GET['type']) {
		case 'css':
			header ("Content-Type: text/css; charset: UTF-8");
		break;
 
		case 'js':
			header ("Content-Type: text/javascript; charset: UTF-8");
		break;
	}

I’m glad you got it sorted. :slight_smile: