Cloudflare pages serves images as text/html

For Workers & Pages, what is the name of the domain?

isbnviz.pages.dev

What is the issue or error you’re encountering

Locally, my images are served as images, meaning with Content type jpeg. However when deployed, the same files are served as text/html.

What are the steps to reproduce the issue?

on my page https://isbnviz.pages.dev/
open dev settings > Network > i see the images coming in as html.

It looks like those jpg files don’t exist in your site as uploaded. Since you don’t have a 404.html, Pages is falling back to SPA behavior and returning the HTML content of your index page.

Make sure you’re uploading your entire site folder. Are you using direct upload from the dashboard, or Wranger, or Github?

4 Likes

Thank you for the quick answer! Indeed you are correct - I did something stupid, they were .gitignored, hence they didnt show up. I was confused aswell by the lack of 404 so i didnt really investigate. anyway, it now works, as you can see on the site haha.

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