Skip to content

File preview: root-relative markdown images (/images/…) render as missing #23623

Closed

Description

@inariku

Existing issues

  • I searched open issues and this is not already reported.

KiroCrew version

0.9.0.4

Release channel

Not sure

How is it installed?

Desktop app

Platform

Not platform-specific

What happened

A markdown file opened in the file preview shows every image written as a root-relative path (![…](/images/…/x.png)) as a broken-image chip reading "Image file no longer exists", although the files are on disk.

/images/… is the conventional way to reference an image from the root of the repository or site the markdown belongs to. GitHub renders a root-relative image in a README against the repository root, and Zenn, Docusaurus and similar static-site setups write images the same way. The preview instead reads the path as an absolute filesystem path (/images/… at the root of the disk), so /api/file-raw answers 404, and the HEAD probe turns that into the "no longer exists" wording.

Expected: when the absolute path does not exist and the image sits in a file preview (a BasePathCtx is set), the preview also tries the path against the directories above the markdown file, nearest first, and shows the first one that loads. A path that really is absolute (/Users/…/shot.png) keeps working on the first request.

The cause is in website/src/components/markdown/ImgWithFallback.tsx: the basePath branch resolves only paths that do not start with /, ~ or a drive letter, so a leading-slash path is sent to /api/file-raw verbatim.

Steps to reproduce

  1. Create repo/articles/post.md containing ![shot](/images/post/shot.png) and put an image at repo/images/post/shot.png.
  2. Open repo/articles/post.md in the dashboard's file preview.
  3. The image renders as a broken-image chip, "Image file no longer exists".

Anything else

Workaround today: rewrite the link relative to the file (../images/post/shot.png). That breaks the image on the site the markdown is published to, so it is not a real fix for the file's author.

Related but separate: #10197 (Obsidian ![[…]] embeds in the Notes app) and #4084 (relative images in the Notes app).

Activity

  1. added a commit that references this issue on Oct 24, 2026
    3a961f9
  2. added
    tier:T1Bug: behaviour does not match intent; fix keeps the design
    on Oct 24, 2026
  3. KiroCrewCaptain commented on Oct 24, 2026

    @KiroCrewCaptain
    Collaborator

    Thanks for the report. This issue has been triaged by Crew Captain and will be assigned to a maintainer, who will follow up here.

  4. added 2 commits that reference this issue on Oct 24, 2026
    dd17a63
    9388f8e
  5. inariku commented on Oct 24, 2026

    @inariku
    ContributorAuthor

    /claim

    Fix is up in #23631.

  6. added a commit that references this issue on Oct 24, 2026
    5d3c5d0
  7. KiroCrewCaptain commented on Oct 24, 2026

    @KiroCrewCaptain
    Collaborator

    @inariku, this issue cannot be claimed right now: someone is already working on it.

  8. added 5 commits that reference this issue on Oct 24, 2026
    e209a78
    4d945de
    0e706a9
    32a51af
    5124aef
  9. added a commit that references this issue on Oct 25, 2026
    2719ba9
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    tier:T1Bug: behaviour does not match intent; fix keeps the design

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions