When uploading site to cloudflare, CSS is broken

When accessing my website after uploading to Cloudflare the CSS does not want to load.

I get the following errors:

The youtube errors I am not worried about. I also understand there have been other forum posts with similar issues but I feel like I have read quite a lot of forum posts and tried a lot of different things and have had no luck.

The site loads and works fine when I load it up locally, but not when hosted on Cloudflare.

I am building the site from a template and when uploading the unedited template/clearing cache the page does work if I upload as a folder, but not if I upload as zip or from github. Apposed to my edited version of the template/site which will not work no matter how I load it.

I have tried:

  1. purge cache/try dev mode
  2. rename CSS file?
  3. bunch of other stuff I can’t remember (im only learning and also very blazed)
  4. remove comments from top of file

It looks like your CSS files don’t exist at the specified paths. And, you don’t have a 404.html file, so instead of just returning 404 not found, Pages returns the main page instead (SPA behavior).

Is your github repo public?

Thanks for the reply, sorry I took a few days to get back to you.

My github repo is not public, however I get same issue when uploading my website directly to Cloudflare leaving github out of the equation completely.

My webpage also loads perfectly fine when I open I load it up from local storage.

The errors are consistent with the CSS file not existing in the build output directory (at least not at the specified path). The source maps for the Bootstrap files, too, and the pages that are linked from the main page.

Is it possible you’re putting all your files in a subdirectory of the build directory, instead of in the build directory itself?

Just upload the root folder from my local storage. Looks to have same file/folder structure as it did before I uploaded it.

I might attempt to host the website elsewhere to see if the result is reproduced.
Very likely It’s something glaringly obvious but I just remember having a much easier time last time I was messing with web hosting lol.

You want css, not CSS. URL paths are case-sensitive.

2 Likes

DUUUUUUDE! Thank you so much. I can’t believe I overlooked that! Absolute legend, I knew it was something obvious.

Really appreciate it :slight_smile:

1 Like

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