Summary
Upgrading @anthropic-ai/claude-agent-sdk from 0.2.91 to 0.2.96 breaks Bun compiled builds (bun build --compile) because extractFromBunfs.js imports ./tempfile.js, but that file is not present in the published package.
Error:
17 | import { tmpdir } from './tempfile.js'
^
error: Could not resolve: \"./tempfile.js\"
at .../node_modules/@anthropic-ai/claude-agent-sdk/extractFromBunfs.js:17:24
Environment
- macOS Darwin 25.2.0 (arm64)
- Bun
1.3.10
@anthropic-ai/claude-agent-sdk 0.2.96
- Tauri app sidecar compiled with Bun (
bun build --compile)
Reproduction
- Install SDK 0.2.96:
bun add @anthropic-ai/claude-agent-sdk@0.2.96
- Use this minimal repro file (
agent-bridge.repro.ts):
import cliPath from "@anthropic-ai/claude-agent-sdk/embed";
console.log("Embedded CLI path:", cliPath);
- Compile with Bun:
bun build --compile --target=bun agent-bridge.repro.ts --outfile /tmp/agent-bridge-repro
- Build fails with
Could not resolve: "./tempfile.js".
Additional checks
- In
0.2.96, extractFromBunfs.js imports ./tempfile.js.
tempfile.js is missing from package contents.
- The package
files list also does not include tempfile.js.
- Rolling back to
0.2.91 restores successful compile in the same environment.
Expected behavior
bun build --compile should succeed with recent SDK versions, and all internal imports in published files should resolve.
Actual behavior
Build fails due to missing module in published artifact (./tempfile.js).
Related context
Looks related to earlier Bun bundling/runtime packaging concerns (e.g. #150), but this appears to be a different concrete failure mode (missing file in npm artifact).
Summary
Upgrading
@anthropic-ai/claude-agent-sdkfrom0.2.91to0.2.96breaks Bun compiled builds (bun build --compile) becauseextractFromBunfs.jsimports./tempfile.js, but that file is not present in the published package.Error:
Environment
1.3.10@anthropic-ai/claude-agent-sdk0.2.96bun build --compile)Reproduction
agent-bridge.repro.ts):Could not resolve: "./tempfile.js".Additional checks
0.2.96,extractFromBunfs.jsimports./tempfile.js.tempfile.jsis missing from package contents.fileslist also does not includetempfile.js.0.2.91restores successful compile in the same environment.Expected behavior
bun build --compileshould succeed with recent SDK versions, and all internal imports in published files should resolve.Actual behavior
Build fails due to missing module in published artifact (
./tempfile.js).Related context
Looks related to earlier Bun bundling/runtime packaging concerns (e.g. #150), but this appears to be a different concrete failure mode (missing file in npm artifact).