What happened?
The rendered-markdown example extension fails to load in the compiled hunk binary:
Extension rendered-markdown failed to load • Cannot find package 'marked' imported from /Users/<me>/.config/hunk/extensions/rendered-markdown/index.ts
marked is installed in the extension's own node_modules, which the folder extension docs say is supported.
Environment: macOS 26 (Darwin 25.6.0, arm64), Ghostty 1.3.2, zsh. hunkdiff is installed globally with Bun 1.4.2 (it runs the hunkdiff-darwin-arm64 binary). config.toml has no [extensions] settings.
Workaround: Importing by relative path loads fine, and F8 renders the Markdown:
import { Lexer, type Token, type Tokens } from "./node_modules/marked/lib/marked.esm.js";
Suspected cause (unconfirmed): registerHostRuntimeModules (packages/hunk/src/extensions/hostRuntimeModules.ts) serves extension files through a Bun.plugin onLoad hook that returns transpiled contents. My guess is that inside a bun build --compile binary, bare specifiers in that returned code aren't resolved from the importing file's directory, while relative ones are. The folder-local node_modules coverage from #606 may only run from source.
Steps to reproduce
git clone --depth 1 https://github.com/modem-dev/hunk
mkdir -p ~/.config/hunk/extensions
cp -R hunk/examples/extensions/rendered-markdown ~/.config/hunk/extensions/
(cd ~/.config/hunk/extensions/rendered-markdown && bun install) # installs marked@17.0.1
cd "$(mktemp -d)"
printf '# Hi\n\nold\n' > before.md
printf '# Hi\n\n**new** text\n' > after.md
hunk diff --files before.md after.md
The load error appears in the status bar, and F8 does nothing.
Expected behavior
The extension loads, and F8 (View → File presentation: Rendered Markdown) shows the rendered Markdown view.
Version
0.23.0
What happened?
The
rendered-markdownexample extension fails to load in the compiledhunkbinary:markedis installed in the extension's ownnode_modules, which the folder extension docs say is supported.Environment: macOS 26 (Darwin 25.6.0, arm64), Ghostty 1.3.2, zsh.
hunkdiffis installed globally with Bun 1.4.2 (it runs thehunkdiff-darwin-arm64binary).config.tomlhas no[extensions]settings.Workaround: Importing by relative path loads fine, and F8 renders the Markdown:
Suspected cause (unconfirmed):
registerHostRuntimeModules(packages/hunk/src/extensions/hostRuntimeModules.ts) serves extension files through aBun.pluginonLoadhook that returns transpiledcontents. My guess is that inside abun build --compilebinary, bare specifiers in that returned code aren't resolved from the importing file's directory, while relative ones are. The folder-localnode_modulescoverage from #606 may only run from source.Steps to reproduce
The load error appears in the status bar, and F8 does nothing.
Expected behavior
The extension loads, and F8 (View → File presentation: Rendered Markdown) shows the rendered Markdown view.
Version
0.23.0