[BUG] Image reading - `(B.default || B) is not a function`

Status Closed — not planned
Maintainer reply ✓ Yes — dicksontsai
Activity 14 comments · opened Jul 8, 2025 · closed Jan 4, 2026
💡 Likely answer: A maintainer (dicksontsai, collaborator) responded on this thread — see the highlighted reply below.

Environment

  • Platform (select one):
  • [x] Anthropic API
  • [ ] AWS Bedrock
  • [ ] Google Vertex AI
  • [ ] Other: <!-- specify -->
  • Claude CLI version: 1.0.44 (Claude Code)
  • Operating System: macOS
  • Terminal: iTerm2

Bug Description

I consistenly get this when trying to read images

⏺ Read(foo.png)
  ⎿  Error: (B.default || B) is not a function

View original on GitHub ↗

14 Comments

Quidge · 1 year ago

Same issue. I came here to see if there were others. I thought it might be an Anthropic API hiccup but a re-request of the same files spit out the same thing:

> please try to read the missing files again

⏺ I'll try to read the missing PDF files again to get a complete picture of all the companies in the report.

⏺ Read(pdf_imgs/report-0.png)
  ⎿  Error: (B.default || B) is not a function

⏺ Read(pdf_imgs/report-1.png)
  ⎿  Error: (B.default || B) is not a function

⏺ Read(pdf_imgs/report-2.png)
  ⎿  Error: (B.default || B) is not a function

⏺ Read(pdf_imgs/report-4.png)
  ⎿  Error: (B.default || B) is not a function

⏺ Read(pdf_imgs/report-5.png)
  ⎿  Error: (B.default || B) is not a function

⏺ Read(pdf_imgs/report-11.png)
  ⎿  Error: (B.default || B) is not a function

⏺ Read(pdf_imgs/report-13.png)
  ⎿  Error: (B.default || B) is not a function

⏺ Read(pdf_imgs/report-14.png)
  ⎿  Error: (B.default || B) is not a function

Same setup as vemv:

  • Claude CLI version: 1.0.44
  • Operating System: macOS
  • Terminal: iTerm2
  • Anthropic API
dicksontsai collaborator · 1 year ago

This issue is due to an image processing dependency that did not get installed on your device. What kind of macOS chip are you running with?

We will introduce error handling so that Claude Code at least attempts to use the original image if the image processing dependency is missing.

Quidge · 1 year ago

I'm on an M3. From my hardware details section on my About This Mac:

  Model Name:	MacBook Pro
  Model Identifier:	Mac15,7
  Model Number:	MRW13LL/A
  Chip:	Apple M3 Pro
  Total Number of Cores:	12 (6 performance and 6 efficiency)
  Memory:	18 GB
  System Firmware Version:	11881.41.5
  OS Loader Version:	10151.140.19.700.2
Quidge · 1 year ago

I won't be able to until next week, but happy to try replicating the same scenario with claude --debug when I'm back. Didn't occur to me in the moment.

vemv · 1 year ago

M2 Max here

dicksontsai collaborator · 1 year ago

Interesting, how did both of your install Claude Code? Did you use npm, bun, or some other method?

vemv · 1 year ago

npm

triangle959 · 1 year ago

same issue, I use npm install claude code, Is this issue only occurring on the Mac OS? my processor is Intel

wolffiex collaborator · 1 year ago

I wonder if this is specific to intel macs. We do have a separate code path for that.

vemv · 1 year ago

I'm on a M2 though, so there are reports for both architectures

cakeface · 1 year ago

Same issue. Macos apple silicon. Running in Fish shell if that's useful. Also why does it say the file doesn't exist using the @?

⏺ Read(@pending.png)
  ⎿  Error: File does not exist.

⏺ Read(pending.png)
  ⎿  Error: (B.default || B) is not a function
github-actions[bot] · 8 months ago

This issue has been inactive for 30 days. If the issue is still occurring, please comment to let us know. Otherwise, this issue will be automatically closed in 30 days for housekeeping purposes.

github-actions[bot] · 7 months ago

This issue has been automatically closed due to 60 days of inactivity. If you're still experiencing this issue, please open a new issue with updated information.

github-actions[bot] · 7 months ago

This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.