[BUG] Sharp module fails to load on win32-x64 in v2.1.79, breaking all image processing for large images
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?
Description
Claude Code v2.1.79 (VSCode extension) cannot load its bundled sharp module on Windows x64. This causes all image attachments larger than 2000x2000px or ~3.7MB to fail with a misleading error message about dimensions exceeding limits.
The actual underlying error is:
Could not load the "sharp" module using the win32-x64 runtime
This is masked by the catch block in the image resize path, which surfaces a misleading user-facing error:
Unable to resize image — dimensions exceed the 2000x2000px limit and image processing failed.
Please resize the image to reduce its pixel dimensions.
Environment
OS: Windows 11 Pro (win32-x64)
VSCode: Latest
Claude Code Extension: v2.1.79
Extension variant: anthropic.claude-code-2.1.79-win32-x64 (platform-specific package)
Steps to Reproduce
Install Claude Code v2.1.79 on Windows x64
Open a conversation
Attach/paste any screenshot or image larger than 2000x2000 pixels
Send the message
Expected Behavior
The extension resizes the image and sends it to the API successfully (this worked in previous versions).
Actual Behavior
The message fails with:
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 win32-x64 runtime
Root Cause (from extension logs)
The extension log (Claude VSCode.log) shows the real error clearly:
[error] Error from Claude: 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 win32-x64
runtime
The image resize function (tk() in cli.js) tries to:
Load a native image processor via rY() check — fails
Fall back to the bundled sharp module — fails with "Could not load the sharp module using the win32-x64 runtime"
The catch block checks if the image is a PNG with dimensions > 2000x2000 and throws the misleading "dimensions exceed" error
Additional Context
Images under 2000x2000px and under ~3.7MB still work because they hit an early-return path that skips the resize entirely
The client_data endpoint (/api/oauth/claude_cli/client_data) also returns repeated 429 errors on startup, though this appears to be a separate issue
This regression started on the same day the win32-x64 platform-specific extension variant was installed
The sharp npm package installed separately (in project node_modules) works perfectly — sharp({ create: { width: 3000, height: 2500, ... } }).resize(2000, 2000) succeeds without issue. The problem is specifically with the extension's bundled sharp binary.
Workaround
Resize images to under 2000x2000px before attaching, so the extension's early-return path is taken and the broken sharp module is never invoked.
Suggestion
The error message should surface the actual sharp loading failure rather than the misleading "dimensions exceed" message. The catch block conflates image processing library failures with actual dimension/size issues.
Confirmed Fix: Rollback to v2.1.78
Rolling back to v2.1.78 via VSCode's "Install Another Version" resolves the issue completely. Image processing works normally on v2.1.78-win32-x64.
This confirms the regression was introduced in v2.1.79's win32-x64 platform package — likely a missing or incompatible sharp native binary in that specific build.
What Should Happen?
Expected Behavior
The extension resizes the image and sends it to the API successfully (this worked in previous versions).
Error Messages/Logs
[error] Error from Claude: 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 win32-x64 runtime
AxiosError: [url=https://api.anthropic.com/api/oauth/claude_cli/client_data,status=429,body=Rate limited. Please try again later.] AxiosError: Request failed with status code 429
at Pu (file:///c:/Users/Aaron/.vscode/extensions/anthropic.claude-code-2.1.79/resources/claude-code/cli.js:77:1188)
at IncomingMessage.<anonymous> (file:///c:/Users/Aaron/.vscode/extensions/anthropic.claude-code-2.1.79/resources/claude-code/cli.js:82:12466)
at IncomingMessage.emit (node:events:531:35)
at endReadableNT (node:internal/streams/readable:1698:12)
at process.processTicksAndRejections (node:internal/process/task_queues:90:21)
at hR6.request (file:///c:/Users/Aaron/.vscode/extensions/anthropic.claude-code-2.1.79/resources/claude-code/cli.js:84:2450)
at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
Steps to Reproduce
Steps to Reproduce
Install Claude Code v2.1.79 on Windows x64
Open a conversation
Attach/paste any screenshot or image larger than 2000x2000 pixels
Send the message
Claude Model
Opus
Is this a regression?
Yes, this worked in a previous version
Last Working Version
v2.1.78
Claude Code Version
anthropic.claude-code-2.1.79-win32-x64
Platform
Anthropic API
Operating System
Windows
Terminal/Shell
VS Code integrated terminal
Additional Information
_No response_
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗