Deno & REPL – Unsupported Media Type on Display Output
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
-
Ensure you have Deno installed.
-
Install the Jupyter extension for Deno:
deno jupyter --install -
Open a fresh
index.tsfile 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
- Create and open a new TypeScript file in Zed.
- Run each cell above using Zed’s REPL integration.
- 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
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
after watching the video here slowly, they demonstrate a way to use d3 with canvas https://zed.dev/blog/repl#typescript
which was useful to me after trying and failing to use observable Plot charts.