non CSS MIME type distribution of CSS files

Chrome: Refused to apply style from 'https://lifechurch.j-m.zip/css/style.css' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled. Firefox: Did not parse stylesheet at 'https://lifechurch.j-m.zip/css/style.css' because non CSS MIME types are not allowed in strict mode. These are the errors that I receive from my CSS files. I am using Hugo to build the project. I have seen some posts that refer to using a worker/pages function to actually change the header, but this seems unreasonable as I shouldn't have to risk extra costs if I somehow managed to reach the functions limits. I don't think this is the desired results that Cloudflare is trying to acheive. I have attempted to use the _headers file to configure /css/*.css and /css/style.css (as that is my css output filename), but neither of these have worked. Is there a resolution for this level of error? Perhaps an function would work, but I don't know what filename I'd put out since I need it to apply to /**/*.css
No description
4 Replies
Cyb3r-Jak3
Cyb3r-Jak310mo ago
How are you uploading your project? There is an issue with some direct uploads where the MIME type doesn’t get processed correctly
mjhika
mjhika10mo ago
I have the project linked to my github repository and doing automatic builds So I'm still investigating this on my end there seems to be something that is preventing the style.css asset from being uploaded yeah for some reason the build happening in Cloudflare is not generating my css but when ran local the css generates just fine yeah seems that for some reason the hugo in cloudflare is not building the css. i just added a change to build with an npm script that will also build the css using tailwind and it actually created and uploaded the file. i'm still having the issue from what i can tell but i fell that i've gotten a stop closer. apologies if this is a bit spammy ok idk much about what is going on 😅 I just changed that tailwind config content option to not use the hugo stats file and using the build script from npm that runs the hugo build command and runs the tailwind cli to build that works all the files are generated and my site works. i tried a deployment with just the hugo site and that didn't work still the tailwindcss doesn't work. perhaps this is my project is configured poorly and the issue is not a cloudflare issue. perhaps it's not but I will need to attempt with a barebones project to see if it's my project config or not
Cyb3r-Jak3
Cyb3r-Jak310mo ago
Is your repo public?
mjhika
mjhika10mo ago
GitHub
GitHub - mjhika/lifechurchmboro.com: website for LifeChurch Middles...
website for LifeChurch Middlesboro. Contribute to mjhika/lifechurchmboro.com development by creating an account on GitHub.