langchain-ai / langchainjs

🦜🔗 Build context-aware reasoning applications 🦜🔗
https://js.langchain.com/docs/
MIT License
12.68k stars 2.18k forks source link

langchain & @langchain/community using old deprecated puppeteer version #6225

Closed hro-mrjvs closed 3 months ago

hro-mrjvs commented 3 months ago

Checked other resources

Example Code

# run in new folder
pnpm init
pnpm i langchain @langchain/community

pnpm i puppeteer@19
#  WARN  deprecated puppeteer@19.11.1: < 22.8.2 is no longer supported

pnpm i puppeteer@latest
# WARN  Issues with peer dependencies found
# .
# ├─┬ langchain 0.2.11
# │ └── ✕ unmet peer puppeteer@^19.7.2: found 22.14.0
# └─┬ @langchain/community 0.2.20
#   └── ✕ unmet peer puppeteer@^19.7.2: found 22.14.0

Error Message and Stack Trace (if applicable)

WARN  deprecated puppeteer@19.11.1: < 22.8.2 is no longer supported

or

WARN  Issues with peer dependencies found
.
├─┬ langchain 0.2.11
│ └── ✕ unmet peer puppeteer@^19.7.2: found 22.14.0
└─┬ @langchain/community 0.2.20
  └── ✕ unmet peer puppeteer@^19.7.2: found 22.14.0

Description

The package langchain and @langchain/community have an optional peer dependencies on a deprecated puppeteer version.

langchain & @langchain/community depends on puppeteer@^19.7.2 puppeteer supported versions are 22.8.2 or higher.

suggested fix: either the peer dependency either gets all versions: ^19.7.2 || ^20.0.0 || ^21.0.0 || ^22.0.0 (there have been no breaking changes that langchain makes use of internally) or simply update to ^22.0.0

System Info

@langchain/community 0.2.20 langchain 0.2.11 pnpm 9.2.0 node v20.1.0 MacOS

dosubot[bot] commented 3 months ago

Hey @hro-mrjvs! 👋 I'm here to help you with bugs, questions, and becoming a contributor. Let's squash those bugs together while we wait for a human maintainer.

To address the issue with the deprecated Puppeteer version in the langchain and @langchain/community packages, you can update the peerDependencies in the package.json files of both packages. Here are the steps:

  1. Update langchain package: Modify the peerDependencies section in the package.json file of the langchain package to include the newer versions of Puppeteer:

    "peerDependencies": {
     "puppeteer": "^19.7.2 || ^20.0.0 || ^21.0.0 || ^22.0.0"
    }

    Alternatively, if you prefer to update it to ^22.0.0 only:

    "peerDependencies": {
     "puppeteer": "^22.0.0"
    }
  2. Update @langchain/community package: Similarly, modify the peerDependencies section in the package.json file of the @langchain/community package:

    "peerDependencies": {
     "puppeteer": "^19.7.2 || ^20.0.0 || ^21.0.0 || ^22.0.0"
    }

    Or, if you prefer to update it to ^22.0.0 only:

    "peerDependencies": {
     "puppeteer": "^22.0.0"
    }

Here is an example of how the peerDependencies section might look in the langchain package:

"peerDependencies": {
  "@aws-sdk/client-s3": "^3.310.0",
  "@aws-sdk/client-sagemaker-runtime": "^3.310.0",
  "@aws-sdk/client-sfn": "^3.310.0",
  "@aws-sdk/credential-provider-node": "^3.388.0",
  "@azure/storage-blob": "^12.15.0",
  "@browserbasehq/sdk": "*",
  "@gomomento/sdk": "^1.51.1",
  "@gomomento/sdk-core": "^1.51.1",
  "@gomomento/sdk-web": "^1.51.1",
  "@mendable/firecrawl-js": "^0.0.13",
  "@notionhq/client": "^2.2.10",
  "@pinecone-database/pinecone": "*",
  "@supabase/supabase-js": "^2.10.0",
  "@vercel/kv": "^0.2.3",
  "@xata.io/client": "^0.28.0",
  "apify-client": "^2.7.1",
  "assemblyai": "^4.0.0",
  "axios": "*",
  "cheerio": "^1.0.0-rc.12",
  "chromadb": "*",
  "convex": "^1.3.1",
  "couchbase": "^4.3.0",
  "d3-dsv": "^2.0.0",
  "epub2": "^3.0.1",
  "fast-xml-parser": "*",
  "handlebars": "^4.7.8",
  "html-to-text": "^9.0.5",
  "ignore": "^5.2.0",
  "ioredis": "^5.3.2",
  "jsdom": "*",
  "mammoth": "^1.6.0",
  "mongodb": ">=5.2.0",
  "node-llama-cpp": "*",
  "notion-to-md": "^3.1.0",
  "officeparser": "^4.0.4",
  "pdf-parse": "1.1.1",
  "peggy": "^3.0.2",
  "playwright": "^1.32.1",
  "puppeteer": "^19.7.2 || ^20.0.0 || ^21.0.0 || ^22.0.0",
  "pyodide": "^0.24.1",
  "redis": "^4.6.4",
  "sonix-speech-recognition": "^2.1.1",
  "srt-parser-2": "^1.2.3",
  "typeorm": "^0.3.20",
  "weaviate-ts-client": "*",
  "web-auth-library": "^1.0.3",
  "ws": "^8.14.2",
  "youtube-transcript": "^1.0.6",
  "youtubei.js": "^9.1.0"
}

Ensure you replicate similar changes in the @langchain/community package's package.json file as well [1][2].

To continue talking to Dosu, mention @dosu.