Open s-natsubori opened 1 month ago
Hello, @s-natsubori! I'm here to help you with any questions or issues you may have. If you need assistance with bug fixes, code-related questions, or becoming a contributor, feel free to ask.
The unmet peer dependencies and build errors you're encountering with @langchain/aws
are likely due to version mismatches between the @aws-sdk
packages and the @smithy/shared-ini-file-loader
package. To resolve these issues, you can align the versions of the @aws-sdk
packages and ensure compatibility with the @smithy
package.
Here are the steps to fix the package versions and resolve the unmet peer dependencies:
Update @aws-sdk
packages to compatible versions:
Ensure that all @aws-sdk
packages are using compatible versions. You can update the versions in your package.json
to the latest compatible versions.
Update @smithy/shared-ini-file-loader
:
Ensure that the @smithy/shared-ini-file-loader
package is updated to a version that exports getSSOTokenFromFile
.
Here is an example of how you can update your package.json
:
{
"dependencies": {
"@langchain/aws": "^0.0.1",
"@langchain/core": "^0.2.9",
"langchain": "^0.2.9",
"@aws-sdk/client-sts": "^3.614.0",
"@aws-sdk/client-sso-oidc": "^3.614.0",
"@smithy/shared-ini-file-loader": "^3.0.0"
},
"resolutions": {
"@aws-sdk/client-sts": "^3.614.0",
"@aws-sdk/client-sso-oidc": "^3.614.0",
"@smithy/shared-ini-file-loader": "^3.0.0"
}
}
Additionally, ensure that all LangChain packages depend on the same instance of @langchain/core
by adding appropriate fields to your project's package.json
:
{
"name": "your-project",
"version": "0.0.0",
"dependencies": {
"@langchain/aws": "^0.0.1",
"langchain": "0.0.207"
},
"resolutions": {
"@langchain/core": "0.1.5"
},
"overrides": {
"@langchain/core": "0.1.5"
},
"pnpm": {
"overrides": {
"@langchain/core": "0.1.5"
}
}
}
This should resolve the unmet peer dependencies and the build errors by ensuring that all related packages are using compatible versions. If the issue persists, you may need to check for any additional updates or compatibility issues with the specific versions of the packages you are using.
To continue talking to Dosu, mention @dosu.
I try
{
"dependencies": {
"@langchain/aws": "^0.0.1",
"@langchain/core": "^0.2.9",
"langchain": "^0.2.9",
"@aws-sdk/client-sts": "^3.614.0",
"@aws-sdk/client-sso-oidc": "^3.614.0",
"@smithy/shared-ini-file-loader": "^3.0.0"
},
"resolutions": {
"@aws-sdk/client-sts": "^3.614.0",
"@aws-sdk/client-sso-oidc": "^3.614.0",
"@smithy/shared-ini-file-loader": "^3.0.0"
}
}
install warning is resolved. but still build is dead.
I did not try @langchain/core=="0.1.5"
Error raise from aws-sdk, so langchain version is not problem. may be.
CC @bracesproul
Hey @s-natsubori I'm unable to reproduce the build error with the code sample you provided:
import { ChatBedrockConverse } from "@langchain/aws";
const model = new ChatBedrockConverse({
model: "anthropic.claude-3-5-sonnet-20240620-v1:0",
region: "us-east-1",
credentials: {
secretAccessKey: "my-secret-key",
accessKeyId: "my-access-key-id",
},
});
Could you provide a public github repo which will allow be to reproduce the issue?
@bracesproul Hi Brace, I am facing the same issue when adding @langchain/aws to a project that uses esbuild. To reproduce you can clone and build this project: https://github.com/massi-ang/obsidian-textgenerator-plugin/tree/feat_bedrock. Note the branch in not master
but feat_bedrock
Checked other resources
Example Code
Error Message and Stack Trace (if applicable)
yarn install raise warning
and build dead with error
Description
Why @langchain/aws has unmet peer dependency? Can I solve this fix some package version???
System Info
platform :windows Node: v20.9.0 yarn: 1.22.19