CSS MIME Type Issue when deploying in cloudflare pages(work on my own machine)

To preface this very new to hugo and webdev btw, but I’d like to learn.

Hey, I am trying to make a website with hugo and when running the server locally everything works perfect, but then when I upload the files to github(with upload I just mean use git to commit everything) and then download them to the cloudflare pages server and make cloudflare build it my site has no css whatsoever. When looking into the logs in my browser this is what I get iljo.dev/:45 Refused to apply style from ‘https://iljo.dev/iljo.dev/css/style.min.973f74b8630ae6c40e94167ffa0902ab4e2dfff599c157bc9b6e236a0aa354fc5fbec0e32ad88b7302af4f61a43c6ca0a1531997de16cba160eae25a549a66b9.css’ because its MIME type (‘text/html’) is not a supported stylesheet MIME type, and strict MIME checking is enabled.
When looking further into this, I never nowhere specify text/html. The css file (style.min.9…) is generated by hugo when running the hugo command, so I can’t change that itself.

This is the line that my browser deems not working(in the console of the browser)

But first and foremost I don’t see what is wrong, and second, even if I knew I can’t edit this file directly.
Could anyone help me with this issue?
Thanks in advance!
kind regards,
Iljo

I thing it maybe could be fixed by changing the rel=“preload stylesheet” to just rel=“stylesheet”, but that Is just my guess and any help would be appreciated.
The site itself can be visited at iljo.dev if you want to check it yourself

You could add a type attribute to the link element. And search online for the error message.
The issue is not related to Hugo, though.

A link to the repository would be more useful, I think.
Never mind. I found it here

Personally, I’d try to pare the stuff down to the absolutely necessary. You’re loading a bunch of stuff (jQuery in 2023 – why?) that you probably don’t need, and make finding your way through Hugo more difficult than necessary.

KISS.

I’m almost certain this isn’t a MIME issue, but rather a “404 not found” issue.

This looks suspicious:

https://iljo.dev/iljo.dev/

Notice the domain part is repeated, so the URL is wrong.

I would start by checking:

  • That the baseURL is correct (I assume https://iljo.dev)
  • And then check that your not doing any magic with the URLs produced by Hugo.

Yea in my config.toml I have this
baseURL = “iljo.dev”
Maybe I shouldn’t do that

You need to add the protocol, I assume

baseURL = “https://iljo.dev”

Thank you very much, I just made a testing branch and commented the baseURL out, and on advice of @chrillek I also commented out the jquerry, and now it works. Thank you very very much

This is not an URL but a domain name. An URL must begin with a protocol like http/s, ftp or file.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.