pedroslopez / whatsapp-web.js

A WhatsApp client library for NodeJS that connects through the WhatsApp Web browser app
https://wwebjs.dev
Apache License 2.0
15.05k stars 3.58k forks source link

Evaluation failed: TypeError: window.Store.ProfilePic.profilePicFind is not a function\n at pptr://__puppeteer_evaluation_script__:4:54 #3230

Open ioisaque opened 1 month ago

ioisaque commented 1 month ago

Is there an existing issue for this?

Describe the bug

{{ HOST }} /contact/getProfilePicUrl/ {{ SESSION_ID }}

This endpoint always return the error:

Evaluation failed: TypeError: window.Store.ProfilePic.profilePicFind is not a function\n at pptr://__puppeteer_evaluation_script__:4:54

Expected behavior

The url of the contatc profile pic.

Steps to Reproduce the Bug or Issue

const options = {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'User-Agent': 'Insomnia/2023.5.1',
    Authorization: 'Bearer {{access_token}}'
  },
  body: '{"contactId":"{{number}}@c.us"}'
};

fetch('http://localhost:3000/contact/getProfilePicUrl/{{session_id}}', options)
  .then(response => response.json())
  .then(response => console.log(response))
  .catch(err => console.error(err));

Relevant Code

No response

Browser Type

Chromium

WhatsApp Account Type

Standard

Does your WhatsApp account have multidevice enabled?

Yes, I am using Multi Device

Environment

MacOS and AWS both giver this error.

Additional context

Could be related, but I haven't been able to fix them.

`➜ whatsapp-api (master) ✗ npm audit

npm audit report

ws 8.0.0 - 8.17.0 Severity: high ws affected by a DoS when handling a request with many HTTP headers - https://github.com/advisories/GHSA-3h5v-q93c-6h6q No fix available node_modules/ws puppeteer-core 11.0.0 - 22.11.1 Depends on vulnerable versions of ws node_modules/puppeteer-core puppeteer 18.2.0 - 22.11.1 Depends on vulnerable versions of puppeteer-core node_modules/puppeteer whatsapp-web.js 1.23.1-alpha.0 - 1.25.0 Depends on vulnerable versions of puppeteer node_modules/whatsapp-web.js

4 high severity vulnerabilities

Some issues need review, and may require choosing a different dependency. `

BenyFilho commented 1 month ago

Using Exodus Version Requer Node 18+ 1- npm install whatsapp-web.js; 2- If you are using, remove WebCache; 3- delete folders node_modules and wwebjs_auth; 4- npm install; 5- start seu bot.