I get an API Error error when I'm on the company network,...

Status Fixed / completed
Maintainer reply None cached
Activity 4 comments · opened Nov 26, 2025 · closed Nov 26, 2025

Bug Description
I get an API Error error when I'm on the company network, but I don't have any problems with the desktop app or claude.ai, only with claude code.

Environment Info

  • Platform: darwin
  • Terminal: Apple_Terminal
  • Version: 2.0.54
  • Feedback ID:

Errors

[{"error":"Error\n    at <anonymous> (/$bunfs/root/claude:14:14648)\n    at <anonymous> (/$bunfs/root/claude:32:10219)\n    at emitError (node:events:43:23)\n    at <anonymous> (/$bunfs/root/claude:31:1146)\n    at emitError (node:events:43:23)\n    at <anonymous> (node:_http_client:248:22)\n    at processTicksAndRejections (native:7:39)\n    at request (/$bunfs/root/claude:34:2147)\n    at processTicksAndRejections (native:7:39)","timestamp":"2025-11-26T07:19:27.693Z"},{"error":"Error\n    at <anonymous> (/$bunfs/root/claude:14:14648)\n    at <anonymous> (/$bunfs/root/claude:32:10219)\n    at emitError (node:events:43:23)\n    at <anonymous> (/$bunfs/root/claude:31:1146)\n    at emitError (node:events:43:23)\n    at <anonymous> (node:_http_client:248:22)\n    at processTicksAndRejections (native:7:39)\n    at request (/$bunfs/root/claude:34:2147)\n    at processTicksAndRejections (native:7:39)","timestamp":"2025-11-26T07:19:27.696Z"},{"error":"Error\n    at <anonymous> (/$bunfs/root/claude:14:14648)\n    at <anonymous> (/$bunfs/root/claude:32:10219)\n    at emitError (node:events:43:23)\n    at <anonymous> (/$bunfs/root/claude:31:1146)\n    at emitError (node:events:43:23)\n    at <anonymous> (node:_http_client:248:22)\n    at processTicksAndRejections (native:7:39)\n    at request (/$bunfs/root/claude:34:2147)\n    at processTicksAndRejections (native:7:39)","timestamp":"2025-11-26T07:19:27.722Z"},{"error":"Error\n    at <anonymous> (/$bunfs/root/claude:14:14648)\n    at <anonymous> (/$bunfs/root/claude:32:10219)\n    at emitError (node:events:43:23)\n    at <anonymous> (/$bunfs/root/claude:31:1146)\n    at emitError (node:events:43:23)\n    at <anonymous> (node:_http_client:248:22)\n    at processTicksAndRejections (native:7:39)\n    at request (/$bunfs/root/claude:34:2147)\n    at processTicksAndRejections (native:7:39)","timestamp":"2025-11-26T07:19:34.202Z"},{"error":"Error\n    at <anonymous> (/$bunfs/root/claude:14:14648)\n    at <anonymous> (/$bunfs/root/claude:32:10219)\n    at emitError (node:events:43:23)\n    at <anonymous> (/$bunfs/root/claude:31:1146)\n    at emitError (node:events:43:23)\n    at <anonymous> (node:_http_client:248:22)\n    at processTicksAndRejections (native:7:39)\n    at request (/$bunfs/root/claude:34:2147)\n    at processTicksAndRejections (native:7:39)","timestamp":"2025-11-26T07:19:34.261Z"},{"error":"Error\n    at <anonymous> (/$bunfs/root/claude:14:14648)\n    at <anonymous> (/$bunfs/root/claude:32:10219)\n    at emitError (node:events:43:23)\n    at <anonymous> (/$bunfs/root/claude:31:1146)\n    at emitError (node:events:43:23)\n    at <anonymous> (node:_http_client:248:22)\n    at processTicksAndRejections (native:7:39)\n    at request (/$bunfs/root/claude:34:2147)\n    at processTicksAndRejections (native:7:39)","timestamp":"2025-11-26T07:19:34.463Z"},{"error":"Error\n    at <anonymous> (/$bunfs/root/claude:14:14648)\n    at <anonymous> (/$bunfs/root/claude:32:10219)\n    at emitError (node:events:43:23)\n    at <anonymous> (/$bunfs/root/claude:31:1146)\n    at emitError (node:events:43:23)\n    at <anonymous> (node:_http_client:248:22)\n    at processTicksAndRejections (native:7:39)\n    at request (/$bunfs/root/claude:34:2147)\n    at processTicksAndRejections (native:7:39)","timestamp":"2025-11-26T07:19:36.189Z"},{"error":"Error\n    at <anonymous> (/$bunfs/root/claude:14:14648)\n    at <anonymous> (/$bunfs/root/claude:32:10219)\n    at emitError (node:events:43:23)\n    at <anonymous> (/$bunfs/root/claude:31:1146)\n    at emitError (node:events:43:23)\n    at <anonymous> (node:_http_client:248:22)\n    at processTicksAndRejections (native:7:39)\n    at request (/$bunfs/root/claude:34:2147)\n    at processTicksAndRejections (native:7:39)","timestamp":"2025-11-26T07:19:36.560Z"},{"error":"Error\n    at <anonymous> (/$bunfs/root/claude:14:14648)\n    at <anonymous> (/$bunfs/root/claude:32:10219)\n    at emitError (node:events:43:23)\n    at <anonymous> (/$bunfs/root/claude:31:1146)\n    at emitError (node:events:43:23)\n    at <anonymous> (node:_http_client:248:22)\n    at processTicksAndRejections (native:7:39)\n    at request (/$bunfs/root/claude:34:2147)\n    at processTicksAndRejections (native:7:39)","timestamp":"2025-11-26T07:19:37.034Z"},{"error":"Error\n    at <anonymous> (/$bunfs/root/claude:14:1464

Note: Error logs were truncated.

View original on GitHub ↗

4 Comments

github-actions[bot] · 10 months ago

Found 3 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/12353
  2. https://github.com/anthropics/claude-code/issues/11464
  3. https://github.com/anthropics/claude-code/issues/8032

This issue will be automatically closed as a duplicate in 3 days.

  • If your issue is a duplicate, please close it and 👍 the existing issue instead
  • To prevent auto-closure, add a comment or 👎 this comment

🤖 Generated with Claude Code

emrahtokalak · 10 months ago

<img width="599" height="236" alt="Image" src="https://github.com/user-attachments/assets/ac1943ba-24d8-420e-b564-108f5d497a6c" />

emrahtokalak · 10 months ago

Solution Found

This issue was caused by corporate network SSL inspection (TLS interception). The corporate firewall uses a self-signed certificate to inspect HTTPS traffic, which Node.js/Bun doesn't trust by default since it doesn't read from macOS Keychain.

Root Cause

Node.js maintains its own CA certificate store and doesn't utilize the macOS Keychain, even if corporate certificates are already installed there.

Workaround

1. Export certificates from macOS Keychain:

security find-certificate -a -p /Library/Keychains/System.keychain > ~/corporate-certs.pem

2. Configure Node.js to use the exported certificates:

For zsh:

echo 'export NODE_EXTRA_CA_CERTS=~/corporate-certs.pem' >> ~/.zshrc
source ~/.zshrc

For bash:

echo 'export NODE_EXTRA_CA_CERTS=~/corporate-certs.pem' >> ~/.bash_profile
source ~/.bash_profile
[!NOTE] This approach maintains SSL validation while allowing the corporate certificate to be trusted. Avoid using NODE_TLS_REJECT_UNAUTHORIZED=0 as it completely disables certificate verification.

Suggestion

Consider adding documentation for corporate network environments or implementing automatic detection of system CA certificates on macOS.

github-actions[bot] · 10 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.