Skip to content

Conversation

@akintunero
Copy link
Contributor

@akintunero akintunero commented Sep 27, 2025

Fix: Add langsmith to import map to resolve Issue #9049

Problem
In version 1.0.0-alpha.5, users experience errors when using the pull() function from langchain/hub:

Error loading "langsmith" package, install it via npm install langsmith
Error: require_range is not a function. (In 'require_range()', 'require_range' is undefined)

The issue occurs because langsmith components are not properly available in the import map during deserialization.

Solution

Added langsmith entry to extraImportMapEntries in langchain.config.js to ensure langsmith components are properly resolved in the import map.

Changes

  • Added langsmith entry to extraImportMapEntries (lines 358-362):
    {
      modules: ["Client"],
      alias: ["langsmith"],
      path: "langsmith",
    }
  • Ensures langsmith components are available during deserialization
  • Maintains backward compatibility

Testing

  • ✅ Import map contains langsmith entry
  • ✅ Hub pull function works without errors
  • ✅ Agent creation works with langsmith components
  • ✅ Serialization/deserialization works properly

Impact

Fixes #9049

@changeset-bot
Copy link

changeset-bot bot commented Sep 27, 2025

⚠️ No Changeset found

Latest commit: 272d3c3

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

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

@vercel
Copy link

vercel bot commented Sep 27, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
langchainjs-docs Ready Ready Preview Sep 27, 2025 3:40pm
1 Skipped Deployment
Project Deployment Preview Comments Updated (UTC)
langchainjs-api-refs Ignored Ignored Sep 27, 2025 3:40pm

Copy link
Member

@christian-bromann christian-bromann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

Thank you!

@christian-bromann christian-bromann merged commit 84aee58 into langchain-ai:main Sep 29, 2025
33 checks passed
hntrl added a commit that referenced this pull request Oct 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

loadLangSmith in 1.0.0-alpha.5 has incorrect langsmith import path

3 participants