[BUG] VSCode: Pasting images crashes process (exit code 1) - image-processor.node not loadable from bun virtual FS

Resolved 💬 4 comments Opened Mar 8, 2026 by myprestarocks Closed Apr 27, 2026

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

Pasting/attaching images in the VSCode Claude Code panel crashes the process with exit code 1. Text-only messages work fine. The Read tool can also process images without crashing (the error is caught there), but the user prompt image processing path has an unhandled error that kills the process.

Root cause from binary inspection:

The claude binary (bun-compiled) tries to load a custom native addon:

// D9L (minified)
require("/$bunfs/root/image-processor.node")

This always fails because bun cannot load .node native addons from its virtual filesystem (/$bunfs/). The getNativeModule() function catches this and returns null, but the sharp() wrapper then throws an unhandled Error("Native image processor module not available") during user prompt image processing, crashing the process.

The Read tool uses the same sharp wrapper but has a try/catch that gracefully handles the failure. The user prompt path (_vqhl()) does not catch it.

This is the same pattern as #30915 (audio-capture.node path hardcoded to CI build machine on Windows). Unlike audio-capture, there is no IMAGE_PROCESSOR_NODE_PATH env var override available.

What Should Happen?

Images pasted in the chat should either:

  1. Be processed by the native image processor (if the .node file is properly bundled/extracted), or
  2. Gracefully fall back to sending the raw image to the API without resizing (the API handles this fine)

Error Messages/Logs

[ERROR] "Error: Error: Native image processor module not available\n    at <anonymous> (/$bunfs/root/src/entrypoints/cli.js:1085:13113)\n    at D (/$bunfs/root/src/entrypoints/cli.js:1085:13187)\n    at metadata (/$bunfs/root/src/entrypoints/cli.js:1085:13311)\n    at HU (/$bunfs/root/src/entrypoints/cli.js:1125:1637)\n    at async hl (/$bunfs/root/src/entrypoints/cli.js:1125:4502)\n    at async _vq (/$bunfs/root/src/entrypoints/cli.js:13330:1130)\n    at async NQ$ (/$bunfs/root/src/entrypoints/cli.js:13328:3800)\n    at processTicksAndRejections (native:7:39)"

[error] Error from Claude (on channel ...): Error: Claude Code process exited with code 1

Note: The bundled sharp JS code (which tries require('@img/sharp-linux-x64/sharp.node')) is never used as a fallback — the custom image-processor.node path is the only one attempted.

Steps to Reproduce

  1. Connect to a Linux server via VSCode Remote SSH
  2. Open Claude Code panel
  3. Paste or attach any image (screenshot, PNG, etc.)
  4. Process immediately crashes with exit code 1

Attempted Workarounds (none worked)

  • Installing @img/sharp-linux-x64@0.34.5 + @img/sharp-libvips-linux-x64@1.2.4 in ~/node_modules/
  • Setting NODE_PATH via claudeCode.environmentVariables, .bashrc, and claudeProcessWrapper
  • Copying sharp native bindings next to the claude binary in the extension directory
  • All of the above make the CLI (claude -p with image via stream-json) work, but the VSCode extension still crashes because it uses the image-processor.node path, not the standard sharp resolution

Claude Model

Opus 4.6

Is this a regression?

I don't know

Claude Code Version

2.1.71 (Claude Code)

Platform

Anthropic API (OAuth)

Operating System

Debian 12 (TrueNAS), Linux 6.12, x86_64, accessed via VSCode Remote SSH

Terminal/Shell

bash

Additional Information

  • The image-processor.node native addon is compiled into the bun binary's virtual FS reference but cannot be loaded because bun does not support dlopen() from /$bunfs/
  • The full sharp JS code IS bundled in the binary and lists @img/sharp-linux-x64 as an optional dependency, but it's never reached as a fallback
  • The Read tool processes images through the same sharp() wrapper but catches the error — only the user prompt path crashes
  • Related: #30915 (identical pattern with audio-capture.node)

View original on GitHub ↗

This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗