Skip to content

Conversation

dqbd
Copy link
Collaborator

@dqbd dqbd commented Jun 5, 2025

Using similar tactics as in langchain-ai/langgraphjs#1216, with addition of following:

  1. Fix new TypeScript errors that are actually valid bugs (unreachable code after ??)
  2. Dedupe packages such as mongo, dpdm etc. to avoid TypeScript resolution errors whenever possible (exception is Zep since it imports langchain as peerDep)
  3. Add @ts-ignore flags to package imports that export types that are incompatible with CJS (@langchain/google-webauth, @langchain/ollama). @langchain/ollama seems to properly work with CJS, whereas @langchain/google-webauth does not export CJS at all.
  4. Fix default imports such as @langchain/anthropic, Neo4j etc. (dep.default -> dep)

Copy link

vercel bot commented Jun 5, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
langchainjs-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 17, 2025 11:34am
1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
langchainjs-api-refs ⬜️ Ignored (Inspect) Jun 17, 2025 11:34am

@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. auto:bug Related to a bug, vulnerability, unexpected error with an existing feature labels Jun 5, 2025
@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. and removed size:M This PR changes 30-99 lines, ignoring generated files. labels Jun 5, 2025
@afirstenberg
Copy link
Contributor

I saw the comment about @langchain/google-webauth. Will this address the problems that have been documented in #8132 ?

@dqbd
Copy link
Collaborator Author

dqbd commented Jun 5, 2025

I saw the comment about @langchain/google-webauth. Will this address the problems that have been documented in #8132 ?

I don't think so, since web-auth-library does not ship with CJS, only ESM unfortunately. However, I think @langchain/google-gauth should be working fine with CJS though.

@afirstenberg
Copy link
Contributor

afirstenberg commented Jun 5, 2025

I saw the comment about @langchain/google-webauth. Will this address the problems that have been documented in #8132 ?

I don't think so, since web-auth-library does not ship with CJS, only ESM unfortunately. However, I think @langchain/google-gauth should be working fine with CJS though.

We've never gotten a report on the gauth version having issues, so I wasn't worried about that.
Unfortunately, the reason we have so many libraries is because the gauth version doesn't work in some environments, so we needed to provide another auth path.

Anyway - outside this issue, apparently. Thanks!

Using similar tactics as in langchain-ai/langgraphjs#1216, with addition of following:

1. Fix new TypeScript errors that are actually valid bugs (unreachable code after `??`)
2. Dedupe packages such as `mongo`, `dpdm` etc. to avoid TypeScript resolution errors whenever possible (exception is Zep since it imports `langchain` as peerDep)
3. Add `@ts-ignore` flags to package imports that export types that are incompatible with CJS (@langchain/google-webauth, @langchain/ollama)
4. Fix default imports such as @langchain/anthropic, Neo4j etc. (`dep.default` -> `dep`)

Fix format

Avoid circular dependency check for dynamic imports

Fix test

Add test for @langchain/google-gauth

Make as a peer dep
@dqbd dqbd merged commit 8a3c40d into main Jun 17, 2025
86 checks passed
@dqbd dqbd deleted the dqbd/typescript-5.8 branch June 17, 2025 11:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

auto:bug Related to a bug, vulnerability, unexpected error with an existing feature size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants