zed icon indicating copy to clipboard operation
zed copied to clipboard

Deno & REPL – Unsupported Media Type on Display Output

Open frankdierolf opened this issue 7 months ago • 1 comments

Summary

Hola,

found an issue.

Summary

Running the Zed REPL with deno in a TypeScript file works, but rich display outputs (like HTML, Markdown, SVG, or Observable Plot charts) are not rendered. Instead, Zed shows an “Unsupported media type” message.


Description

Environment Setup

  1. Ensure you have Deno installed.

  2. Install the Jupyter extension for Deno:

    deno jupyter --install
    
  3. Open a fresh index.ts file in Zed.

Code to Reproduce

Paste the following into index.ts:

// %%
console.log("Hello, World!");

// %%
await Deno.jupyter.display({
  "text/plain": "Hello, world!",
  "text/html": "<h1>Hello, world!</h1>",
  "text/markdown": "# Hello, world!",
}, { raw: true });

// %%
Deno.jupyter
  .svg`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100">
    <circle cx="50" cy="50" r="40" stroke="green" stroke-width="4" fill="yellow" />
  </svg>`;

// %%
import { document, penguins } from "jsr:@ry/jupyter-helper";
import * as Plot from "npm:@observablehq/plot";

let p = await penguins();

Plot.plot({
  marks: [
    Plot.dot(p.toRecords(), {
      x: "culmen_depth_mm",
      y: "culmen_length_mm",
      fill: "species",
    }),
  ],
  document,
});

Steps to Reproduce

  1. Create and open a new TypeScript file in Zed.
  2. Run each cell above using Zed’s REPL integration.
  3. Observe the output after each block.

Expected Behavior

  • Markdown, HTML, and SVG should render in-place within the REPL output.
  • Observable Plot visualizations should display inline.

Actual Behavior

  • Only console.log("Hello, World!") is rendered.
  • All other display outputs (Markdown, HTML, SVG, Plot) return: ❌ Unsupported media type

Screenshot

Image

Found related Issues:

Python REPL: Support for plots other than matplotlib #19890


Love that zeds has a repl feature. Didn't expect it. Thanks for the great work.

Cheers, Frank ✌

Zed Version and System Specs

Zed: v0.186.7 (Zed Preview) OS: Linux X11 pop 22.04 Memory: 93.5 GiB Architecture: x86_64 GPU: AMD Radeon Graphics (RADV GFX1103_R1) || radv || Mesa 24.2.8-1~bpo12+1pop1~1744225826~22.04~b077665

frankdierolf avatar May 13 '25 09:05 frankdierolf

after watching the video here slowly, they demonstrate a way to use d3 with canvas https://zed.dev/blog/repl#typescript

Image

Image

which was useful to me after trying and failing to use observable Plot charts.

schpet avatar May 28 '25 15:05 schpet