[BUG] sharp module missing on darwin-arm64 causes image resize failure with unhelpful error
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?
Version: 2.1.84 (VSCode extension)
Platform: macOS (darwin-arm64)
Description:
When attaching a screenshot larger than 2000x2000px in the Claude Code VSCode extension, the image resize step fails because the sharp native module is not bundled or installed for darwin-arm64. The error surfaces as a user-facing message about image dimensions, but the root cause is a missing native dependency.
Actual behavior:
Image processing fails and the user sees a confusing error suggesting they resize the image manually, with a stack trace pointing to the bundled cli.js.
Workaround:
Manually resize the screenshot to under 2000x2000px before attaching.
Possibly related? https://github.com/anthropics/claude-code/issues/39185
What Should Happen?
Claude should be able--and did, in the last version of VS Code--to handle screenshots in context.
The extension should either bundle sharp for darwin-arm64 or gracefully downscale the image without requiring a manual install.
Error Messages/Logs
Error: Claude Code returned an error result: Unable to resize image — dimensions exceed the 2000x2000px limit and image processing failed. Please resize the image to reduce its pixel dimensions.; Error: Could not load the "sharp" module using the darwin-arm64 runtime Possible solutions: - Ensure optional dependencies can be installed: npm install --include=optional sharp - Ensure your package manager supports multi-platform installation: See https://sharp.pixelplumbing.com/install#cross-platform - Add platform-specific dependencies: npm install --os=darwin --cpu=arm64 sharp - Consult the installation documentation: See https://sharp.pixelplumbing.com/install at file:///Users/redacted/.vscode/extensions/anthropic.claude-code-2.1.84/resources/claude-code/cli.js:1024:2591 at file:///Users/redacted/.vscode/extensions/anthropic.claude-code-2.1.84/resources/claude-code/cli.js:8:868 at file:///Users/redacted/.vscode/extensions/anthropic.claude-code-2.1.84/resources/claude-code/cli.js:1028:58 at file:///Users/redacted/.vscode/extensions/anthropic.claude-code-2.1.84/resources/claude-code/cli.js:8:868 at file:///Users/redacted/.vscode/extensions/anthropic.claude-code-2.1.84/resources/claude-code/cli.js:1055:10 at file:///Users/redacted/.vscode/extensions/anthropic.claude-code-2.1.84/resources/claude-code/cli.js:8:868 at file:///Users/redacted/.vscode/extensions/anthropic.claude-code-2.1.84/resources/claude-code/cli.js:1055:398 at async gv6 (file:///Users/redacted/.vscode/extensions/anthropic.claude-code-2.1.84/resources/claude-code/cli.js:1055:360) at async by (file:///Users/redacted/.vscode/extensions/anthropic.claude-code-2.1.84/resources/claude-code/cli.js:1055:1779) at async ai (file:///Users/redacted/.vscode/extensions/anthropic.claude-code-2.1.84/resources/claude-code/cli.js:1055:4650)
View output logs · Troubleshooting resources
Steps to Reproduce
Open Claude Code in VSCode on macOS (Apple Silicon)
Attach a screenshot with dimensions > 2000x2000px
Observe error
Claude Model
None
Is this a regression?
Yes, this worked in a previous version
Last Working Version
VS Code 1.112
Claude Code Version
2.1.84 (Claude Code)
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
VS Code integrated terminal
Additional Information
_No response_
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗