Standalone redirection - failed to load CSS

Hello,

I have a standalone application in 2019R2 that runs fine on 2 servers.
I have an other server which is a load balancer. It redirects an URL between the 2 applications servers.
The application seems to load, but all the CSS files fail to load.
I have a message saying

Refused to apply style from ‘https://…animate.css’ because its MIME type (‘text/html’) is not a supported stylesheet MIME type, and strict MIME checking is enabled.

Does anyone has an idea of the problem ?

Regards

Hi Laurent,

You don’t provide details.
Would you mind showing how/where you define your CSS file ?
Tell us also how you implement the load balancer.
Are you using NGINX ?

You could try ‘text/css’ instead.
Also, if you load the CSS from the , try adding <base href="/"> before loading the css files, like
<head>
<base href="/">
<link href=“https://…/style.css” type=“text/css” rel=“stylesheet”>

The error message is probably misleading and just a “file not found”, likely due to (too many) redirects. I agree with @Olivier_Colard that the links to your css in Xojo should be relative and not https:// (I think that is a typo in his answer, as he is mentioning base ref). With that approach you will avoid that the loading of your css file will hit the load balancer and its logic as well for the loading of your script.

:wink: it’s not a typo, it’s something I used before and was related to the same error message, see here
<base href="…"> allows to define the base URL for all relative URLs in the page, here

But you’re right, it could be a misleading error message.

1 Like

I still believe it is ;-). Base ref (https://www.w3schools.com/tags/tag_base.asp) is basically defining the “home” or “root” address for all relative links of that particular page. But this implicitly means that you have to define those links as being relative. However, you are defining it as:

<link href=“https://…/style.css” type=“text/css” rel=“stylesheet”>

https://

With the https: prefix you make the link absolute not relative and the base href will just be ignored for the loading of your script statement. That’s where I assumed the typo :wink: .

correct :wink: my bad, <link href= must be relative

1 Like

No problem, this thread is now probably the best way to explain absolute references versus relative references to someone who doesn’t know the difference :wink: