Skip to content

fix(@langchain/classic): add langsmith as external dependency#9596

Merged
Christian Bromann (christian-bromann) merged 2 commits into
mainfrom
cb/fix-bundling
Dec 11, 2025
Merged

fix(@langchain/classic): add langsmith as external dependency#9596
Christian Bromann (christian-bromann) merged 2 commits into
mainfrom
cb/fix-bundling

Conversation

@christian-bromann

Copy link
Copy Markdown
Member

Problem

Rolldown is bundling langsmith and eventemitter3 into dist/node_modules despite unbundle: true because:

  • langsmith is dynamically imported (await import("langsmith")) in hub/base.ts
  • Rolldown resolves dynamic imports during the build and may bundle them even with unbundle: true
  • eventemitter3 is bundled as a dependency of langsmith

Solution

Added external: ["langsmith", "eventemitter3"] to the tsdown config to explicitly mark them as external. This ensures:

  • They are not bundled into the dist folder
  • They remain as runtime dependencies that must be installed separately
  • Dynamic imports work correctly at runtime

@changeset-bot

changeset-bot Bot commented Dec 8, 2025

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 8ce28a6

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@langchain/classic Patch
@langchain/community Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions github-actions Bot added the ready label Dec 11, 2025
@christian-bromann Christian Bromann (christian-bromann) merged commit 316392e into main Dec 11, 2025
33 checks passed
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.

2 participants