Thinkmill / Thinkmill/keystatic

bug: images return 404 if not present in disk (when using live preview - before github merge)

Open
#1,459 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
2.4k
Forks
159
Avg merge
21h 41m
Merged PRs (30d)
2

Description

Problem

If a collection uses:

  • a fields.image
  • or a content components the use fields.image in its schema

and:

  • storage.kind=github
  • or the current request is for a Live Preview draft (Live Preview forces storage.kind=github)

Every images file return 404 because the URL of the image point to the Backend where keystatic runs, instead of github, and of course the backend disk doesn't have the file yet.

Follow up question

  1. Keystatic, when in github mode, fetch collection entry from github by crafting a Graph QL URL on the fly. Does Keystatic also traverse collection fields and does the same with images?
  2. Is this expected behavior, and we should handle the redirect in the backend server ?
  3. Or did I configure my build incorrectly and should keystatic handle this case without redirects on my side?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the 404 with a collection using fields.image while storage.kind=github and Live Preview is active. Trace how image URLs are produced for GitHub-backed entries and compare that with the backend server path. Done means the expected image behavior is established and verified for both GitHub mode and Live Preview.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
api, backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.