Skip to content

fix: prevent Turbopack build failures when importing harness-claude-code - #19985

Closed
ai-sdk-factory[bot] wants to merge 3 commits into
mainfrom
bugfix-19982-20260829132149537776
Closed

fix: prevent Turbopack build failures when importing harness-claude-code#19985
ai-sdk-factory[bot] wants to merge 3 commits into
mainfrom
bugfix-19982-20260829132149537776

Conversation

@ai-sdk-factory

Copy link
Copy Markdown
Contributor

Background

Importing the published @ai-sdk/harness-claude-code package in a Next.js 16 server route caused the default Turbopack production build to fail.

Root Cause

The bootstrap code emitted a ../bridge/ asset candidate that points outside the published dist/bridge directory; the packaged Next.js reproduction confirmed Turbopack statically rejected that nonexistent path.

Summary

Bridge assets now resolve only beside the source or bundled module, removing the invalid fallback path. Added a patch changeset and removed reproduction-only artifacts.

Testing

Added regression coverage verifying bridge assets resolve correctly from both source and bundled module layouts.

End-to-end Validation

  • pnpm -C examples/ai-functions exec tsx src/reproduction/issue-19982.ts via immutable replay: packaged Next.js 16.3.3 Turbopack build succeeded without externalizing the package.

Related Issues

Fixes #19982

Closes #19983

ai-sdk-factory and others added 3 commits August 29, 2026 13:27
Co-authored-by: brightiron <95196612+brightiron@users.noreply.github.com>
Co-authored-by: brightiron <95196612+brightiron@users.noreply.github.com>
@felixarntz

Copy link
Copy Markdown
Collaborator

worse version of #20033

@felixarntz felixarntz closed this Aug 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

harness-claude-code: readBridgeAsset probes ../bridge/, which never exists in a published install, so Turbopack fails the build

2 participants