hermes - 💡(How to fix) Fix Bug Report: Local `file://` Images Not Rendering in Hermes Desktop App

Official PRs (…)
ON THIS PAGE

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Error Message

Additional Logs / Traceback (optional)

Root Cause

Root Cause Analysis (optional)

Fix Action

Fix / Workaround

**Workaround:** Use CLI or Telegram to send images. Desktop app inline rendering is broken.

A component-level workaround (AsyncImage → converts `file://` paths to data URLs via IPC) was written but needs deployment.

**Workaround:** Use CLI or Telegram to send images. Desktop app inline rendering is broken.

Code Example

**Workaround:** Use CLI or Telegram to send images. Desktop app inline rendering is broken.

---

**Suggested Fix:**
Add `AsyncImage` component to `markdown-text.tsx` that:
1. Intercepts `file://` URLs
2. Converts them to base64 data URLs via `window.hermesDesktop.readFileDataUrl` IPC
3. Passes data URL to the underlying `<img>` tag

This bypasses Chromium's `file://` restriction by never exposing the `file://` protocol to the DOM.

---
RAW_BUFFERClick to expand / collapse

Bug Description

Summary: Inline images using local file:// paths do not render in the Hermes desktop app. They either appear as plain text URLs or broken image placeholders

Steps to Reproduce

Steps to Reproduce:

  1. Open Hermes desktop app (Linux)
  2. Send a message with an inline image using a local path, e.g.: ![Iceland](file:///home/user/Downloads/iceland.png)
  3. Image does not display — see plain URL or broken placeholder instead

Expected Behavior

Expected:* Local images should render inline, same as web-hosted images.

Actual Behavior

Actual: Image fails to load. Chromium's security policy blocks file:// URLs in <img> tags.

Affected Component

Other

Messaging Platform (if gateway-related)

No response

Debug Report

**Workaround:** Use CLI or Telegram to send images. Desktop app inline rendering is broken.

---

**Suggested Fix:**
Add `AsyncImage` component to `markdown-text.tsx` that:
1. Intercepts `file://` URLs
2. Converts them to base64 data URLs via `window.hermesDesktop.readFileDataUrl` IPC
3. Passes data URL to the underlying `<img>` tag

This bypasses Chromium's `file://` restriction by never exposing the `file://` protocol to the DOM.

Operating System

Linux (Ubuntu 22.04)

Python Version

Electron: 40.9.3

Hermes Version

Hermes Desktop: 0.15.2

Additional Logs / Traceback (optional)

Root Cause Analysis (optional)

Root Cause:

Electron (Chromium) sandbox security policy prevents loading file:// URLs in <img> tags by default. The markdown pipeline (streamdown + rehype-harden) processes the path correctly, but the browser refuses to load it at render time.

The rehype-harden library is configured with allowedProtocols: ["*"] so it's not the blocker — the block is at the browser/Chromium level.

A component-level workaround (AsyncImage → converts file:// paths to data URLs via IPC) was written but needs deployment.

Proposed Fix (optional)

Workaround: Use CLI or Telegram to send images. Desktop app inline rendering is broken.


Suggested Fix: Add AsyncImage component to markdown-text.tsx that:

  1. Intercepts file:// URLs
  2. Converts them to base64 data URLs via window.hermesDesktop.readFileDataUrl IPC
  3. Passes data URL to the underlying <img> tag

This bypasses Chromium's file:// restriction by never exposing the file:// protocol to the DOM.

Are you willing to submit a PR for this?

  • I'd like to fix this myself and submit a PR

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING