askrella / whatsapp-chatgpt

ChatGPT + DALL-E + WhatsApp = AI Assistant :rocket: :robot:
3.33k stars 804 forks source link

New error #336

Open witchfindertr opened 3 months ago

witchfindertr commented 3 months ago
Whatsapp ChatGPT & DALL-E ------------------------------------------------------------------------------------------------- A Whatsapp bot that uses OpenAI's ChatGPT and DALL-E to generate text and images from a prompt.

C:\Users\Administrator\Desktop\a\whatsapp-chatgpt-master\node_modules\whatsapp-web.js\src\webCache\LocalWebCache.js:34 const version = indexHtml.match(/manifest-([\d\.]+).json/)[1]; ^

TypeError: Cannot read properties of null (reading '1') at LocalWebCache.persist (C:\Users\Administrator\Desktop\a\whatsapp-chatgpt-master\node_modules\whatsapp-web.js\src\webCache\LocalWebCache.js:34:69) at C:\Users\Administrator\Desktop\a\whatsapp-chatgpt-master\node_modules\whatsapp-web.js\src\Client.js:729:36 at processTicksAndRejections (node:internal/process/task_queues:95:5)

Node.js v18.17.0

connorv001 commented 3 months ago

Which version are you using?

Cryptoverso commented 3 months ago

Alguma solução? estou tento o mesmo problema!! :( └── whatsapp-web.js@1.22.1

/Users/guilhermemelo/Codes/CoinNodes/chatbot/node_modules/whatsapp-web.js/src/webCache/LocalWebCache.js:34 const version = indexHtml.match(/manifest-([\d\.]+).json/)[1]; ^

TypeError: Cannot read properties of null (reading '1') at LocalWebCache.persist (/Users/guilhermemelo/Codes/CoinNodes/chatbot/node_modules/whatsapp-web.js/src/webCache/LocalWebCache.js:34:69) at /Users/guilhermemelo/Codes/CoinNodes/chatbot/node_modules/whatsapp-web.js/src/Client.js:729:36 at processTicksAndRejections (node:internal/process/task_queues:95:5)

Node.js v20.12.0

hkvincent commented 2 months ago

need to change the "whatsapp-web.js": "https://github.com/Julzk/whatsapp-web.js/tarball/jkr_hotfix_7" to "whatsapp-web.js": "https://github.com/Julzk/whatsapp-web.js/tarball/jkr_hotfix_11" in package.json

GreenerX commented 2 months ago

need to change the "whatsapp-web.js": "https://github.com/Julzk/whatsapp-web.js/tarball/jkr_hotfix_7" to "whatsapp-web.js": "https://github.com/Julzk/whatsapp-web.js/tarball/jkr_hotfix_11" in package.json

This didn't help :(

SCR-20240404-pudy
rikuddo91 commented 2 months ago

This worked for me:

npm update whatsapp-web.js

Still giving me the error after scanning the QR Code,

`E:\Temp\whatsapp-chatgpt\node_modules\whatsapp-web.js\node_modules\puppeteer\lib\cjs\puppeteer\common\ExecutionContext.js:221 throw new Error('Evaluation failed: ' + helper_js_1.helper.getExceptionMessage(exceptionDetails)); ^

Error: Evaluation failed: TypeError: Cannot read properties of undefined (reading 'default') at puppeteer_evaluation_script:5:95 at ExecutionContext._evaluateInternal (E:\Temp\whatsapp-chatgpt\node_modules\whatsapp-web.js\node_modules\puppeteer\src\common\ExecutionContext.ts:273:13) at processTicksAndRejections (node:internal/process/task_queues:95:5) at ExecutionContext.evaluate (E:\Temp\whatsapp-chatgpt\node_modules\whatsapp-web.js\node_modules\puppeteer\src\common\ExecutionContext.ts:140:12) at Client.initialize (E:\Temp\whatsapp-chatgpt\node_modules\whatsapp-web.js\src\Client.js:327:9)

Node.js v18.18.0`

GreenerX commented 2 months ago

This worked for me: npm update whatsapp-web.js

Still giving me the error after scanning the QR Code,

`E:\Temp\whatsapp-chatgpt\node_modules\whatsapp-web.js\node_modules\puppeteer\lib\cjs\puppeteer\common\ExecutionContext.js:221 throw new Error('Evaluation failed: ' + helper_js_1.helper.getExceptionMessage(exceptionDetails)); ^

Error: Evaluation failed: TypeError: Cannot read properties of undefined (reading 'default') at puppeteer_evaluation_script:5:95 at ExecutionContext._evaluateInternal (E:\Temp\whatsapp-chatgpt\node_modules\whatsapp-web.js\node_modules\puppeteer\src\common\ExecutionContext.ts:273:13) at processTicksAndRejections (node:internal/process/task_queues:95:5) at ExecutionContext.evaluate (E:\Temp\whatsapp-chatgpt\node_modules\whatsapp-web.js\node_modules\puppeteer\src\common\ExecutionContext.ts:140:12) at Client.initialize (E:\Temp\whatsapp-chatgpt\node_modules\whatsapp-web.js\src\Client.js:327:9)

Node.js v18.18.0`

Yeah still not working for me either after the update..

connorv001 commented 2 months ago

This worked for me: npm update whatsapp-web.js

Still giving me the error after scanning the QR Code, E:\Temp\whatsapp-chatgpt\node_modules\whatsapp-web.js\node_modules\puppeteer\lib\cjs\puppeteer\common\ExecutionContext.js:221 throw new Error('Evaluation failed: ' + helper_js_1.helper.getExceptionMessage(exceptionDetails)); ^ Error: Evaluation failed: TypeError: Cannot read properties of undefined (reading 'default') at **puppeteer_evaluation_script**:5:95 at ExecutionContext._evaluateInternal (E:\Temp\whatsapp-chatgpt\node_modules\whatsapp-web.js\node_modules\puppeteer\src\common\ExecutionContext.ts:273:13) at processTicksAndRejections (node:internal/process/task_queues:95:5) at ExecutionContext.evaluate (E:\Temp\whatsapp-chatgpt\node_modules\whatsapp-web.js\node_modules\puppeteer\src\common\ExecutionContext.ts:140:12) at Client.initialize (E:\Temp\whatsapp-chatgpt\node_modules\whatsapp-web.js\src\Client.js:327:9) Node.js v18.18.0

Yeah still not working for me either after the update..

Did you update?

rikuddo91 commented 2 months ago

Did you update?

Yes, I did.

connorv001 commented 2 months ago

Did you update?

Yes, I did.

what's the verison of whatsapp-webjs

rikuddo91 commented 2 months ago

Did you update?

Yes, I did.

what's the verison of whatsapp-webjs

So I ran npm update whatsapp-web.js

and it updated to version": "1.22.1"

connorv001 commented 2 months ago

Did you update?

Yes, I did.

what's the verison of whatsapp-webjs

So I ran npm update whatsapp-web.js

and it updated to version": "1.22.1"

Try updating puppeteer aslo

connorv001 commented 2 months ago

Did you update?

Yes, I did.

what's the verison of whatsapp-webjs

So I ran npm update whatsapp-web.js

and it updated to version": "1.22.1"

Are you running linux/dockeR?

rikuddo91 commented 2 months ago

Did you update?

Yes, I did.

what's the verison of whatsapp-webjs

So I ran npm update whatsapp-web.js and it updated to version": "1.22.1"

Are you running linux/dockeR?

No, simple Windows 10.

connorv001 commented 2 months ago

Did you update?

Yes, I did.

what's the verison of whatsapp-webjs

So I ran npm update whatsapp-web.js and it updated to version": "1.22.1"

Are you running linux/dockeR?

No, simple Windows 10.

Tried updating pupetter? waht's ypour node verison?

hkvincent commented 2 months ago

need to change the "whatsapp-web.js": "https://github.com/Julzk/whatsapp-web.js/tarball/jkr_hotfix_7" to "whatsapp-web.js": "https://github.com/Julzk/whatsapp-web.js/tarball/jkr_hotfix_11" in package.json

This didn't help :( SCR-20240404-pudy

Did you run 'npm install' after changing to the new version? The issue is definitely related to the version of web.js.

GreenerX commented 2 months ago

need to change the "whatsapp-web.js": "https://github.com/Julzk/whatsapp-web.js/tarball/jkr_hotfix_7" to "whatsapp-web.js": "https://github.com/Julzk/whatsapp-web.js/tarball/jkr_hotfix_11" in package.json

This didn't help :( SCR-20240404-pudy

Did you run 'npm install' after changing to the new version? The issue is definitely related to the version of web.js.

My JSON looks like this after the npm update and npm install:

SCR-20240406-iwyt
GreenerX commented 2 months ago

Now its just stuck on this:

SCR-20240406-iyad
ClaytonCassi commented 2 months ago

doing this step:

const client = new Client({
        puppeteer: {
            args: ["--no-sandbox"]
        },
        webVersionCache: {
            type: 'remote',
            remotePath: `https://raw.githubusercontent.com/wppconnect-team/wa-version/main/html/${wwebVersion}.html`,
        },
        authStrategy: new LocalAuth({
            dataPath: constants.sessionPath
        })
    });

I solve this error -> const version = indexHtml.match(/manifest-([\d\.]+).json/)[1]; TypeError: Cannot read properties of null (reading '1')

but its raise a new puppetter error - > throw new Error('Evaluation failed: ' + helper_js_1.helper.getExceptionMessage(exceptionDetails));
^

Error: Evaluation failed: TypeError: Cannot read properties of undefined (reading 'push') this error persist even when u update puppeteer and whatsappweb.js to lastest version.

Has anyone managed to get the application to work?

zzzeven commented 2 months ago

npm install github:pedroslopez/whatsapp-web.js#webpack-exodus

brumatx commented 1 month ago

npm install github:pedroslopez/whatsapp-web.js#webpack-exodus

The best aswer... works for me!!

Isaakkamau commented 3 weeks ago

I will just drop my debugging steps here.

  1. First of all I deleted all this folders, if they are available in your project: node_modules, session, .wwebjs_cache
  2. Replace you package.json with this one:
    
    {
    "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 ./src"
    },
    "license": "MIT",
    "dependencies": {
        "aws-sdk": "^2.1467.0",
        "chatgpt": "^5.2.5",
        "dotenv": "^16.3.1",
        "fetch-blob": "^4.0.0",
        "ffmpeg": "^0.0.4",
        "langchain": "^0.0.156",
        "openai": "^3.3.0",
        "picocolors": "^1.0.0",
        "qrcode": "^1.5.3",
        "whatsapp-web.js": "github:pedroslopez/whatsapp-web.js#webpack-exodus"
    },
    "engines": {
        "node": ">=18.0.0"
    },
    "devDependencies": {
        "@types/qrcode": "^1.5.2",
        "prettier": "^3.0.3"
    }
    }


3. Re-run: `npm install`
4. finally: `npm run start`