Closed Aj-Butt closed 1 year ago
did you found solution?
no
same issue here . anyone have solution ? try to debug but fail....
Initially it was strict error and now this.
This error has really taken me 2hours. It's being caused by dependency conflicts. Here is what I have done, I have deleted all the dependencies in package.json
and then reinstalled them one by one using npm install <package>
(without specifying version to be installed)
I am using npm@9.8.1
and node@19.9.0
Here is my updated package.json:
{
"name": "whatsapp-chatgpt",
"version": "1.0.0",
"description": "Whatsapp bot that uses OpenAI's GPT & DALLE to respond to user inputs",
"main": "src/index.ts",
"author": "Askrella Software Agency UG (haftungsbeschränkt)",
"scripts": {
"start": "npx vite-node src/index.ts",
"prettier": "prettier --write ."
},
"license": "MIT",
"dependencies": {
"@clack/prompts": "^0.7.0",
"aws-sdk": "^2.1467.0",
"chatgpt-official": "^1.1.9",
"dotenv": "^16.0.3",
"fetch-blob": "^4.0.0",
"langchain": "^0.0.156",
"openai": "^4.10.0",
"qrcode-terminal": "^0.12.0",
"query-string": "^8.1.0",
"querystring": "^0.2.1",
"whatsapp-web.js": "^1.22.1"
},
"devDependencies": {
"@types/fluent-ffmpeg": "^2.1.21",
"@types/qrcode-terminal": "^0.12.0",
"prettier": "^2.8.8"
},
"engines": {
"node": ">=18.0.0"
}
}
Note: Don't install Puppeteer
independently they are conflicting with langchain and If you already have it, uninstall it and run this command npm i langchain
it will be installed by default. Hope this help someone
I fixed lots of issues. It currently works on my side.
I will close this PR for now. If you still have issues, please open another PR.
Thanks!
PS C:\Users\Aj\Pictures\whatsapp-gpt-mobilink> npm run start
(node:27624) NOTE: We are formalizing our plans to enter AWS SDK for JavaScript (v2) into maintenance mode in 2023.
Please migrate your code to use AWS SDK for JavaScript (v3). For more information, check the migration guide at https://a.co/7PzMCcy const { color } = __vite_ssr_import_0__.default;
TypeError: Cannot destructure property 'color' of '__vite_ssr_import_0__.default' as it is undefined. at C:\Users\Aj\Pictures\whatsapp-gpt-mobilink\node_modules\langchain\dist\callbacks\handlers\console.js:25:9 at ViteNodeRunner.directRequest (file:///C:/Users/Aj/Pictures/whatsapp-gpt-mobilink/node_modules/vite-node/dist/client.mjs:328:5) at ViteNodeRunner.cachedRequest (file:///C:/Users/Aj/Pictures/whatsapp-gpt-mobilink/node_modules/vite-node/dist/client.mjs:186:14) at ViteNodeRunner.dependencyRequest (file:///C:/Users/Aj/Pictures/whatsapp-gpt-mobilink/node_modules/vite-node/dist/client.mjs:221:12) at C:\Users\Aj\Pictures\whatsapp-gpt-mobilink\node_modules\langchain\dist\callbacks\manager.js:3:31 at ViteNodeRunner.directRequest (file:///C:/Users/Aj/Pictures/whatsapp-gpt-mobilink/node_modules/vite-node/dist/client.mjs:328:5) at ViteNodeRunner.cachedRequest (file:///C:/Users/Aj/Pictures/whatsapp-gpt-mobilink/node_modules/vite-node/dist/client.mjs:186:14) at ViteNodeRunner.dependencyRequest (file:///C:/Users/Aj/Pictures/whatsapp-gpt-mobilink/node_modules/vite-node/dist/client.mjs:221:12) at C:\Users\Aj\Pictures\whatsapp-gpt-mobilink\node_modules\langchain\dist\llms\base.js:4:31 at ViteNodeRunner.directRequest (file:///C:/Users/Aj/Pictures/whatsapp-gpt-mobilink/node_modules/vite-node/dist/client.mjs:328:5) at ViteNodeRunner.cachedRequest (file:///C:/Users/Aj/Pictures/whatsapp-gpt-mobilink/node_modules/vite-node/dist/client.mjs:186:14) at ViteNodeRunner.dependencyRequest (file:///C:/Users/Aj/Pictures/whatsapp-gpt-mobilink/node_modules/vite-node/dist/client.mjs:221:12) at C:\Users\Aj\Pictures\whatsapp-gpt-mobilink\node_modules\langchain\dist\llms\index.js:1:31 at ViteNodeRunner.directRequest (file:///C:/Users/Aj/Pictures/whatsapp-gpt-mobilink/node_modules/vite-node/dist/client.mjs:328:5) at ViteNodeRunner.cachedRequest (file:///C:/Users/Aj/Pictures/whatsapp-gpt-mobilink/node_modules/vite-node/dist/client.mjs:186:14) at ViteNodeRunner.dependencyRequest (file:///C:/Users/Aj/Pictures/whatsapp-gpt-mobilink/node_modules/vite-node/dist/client.mjs:221:12)