Giter Club home page Giter Club logo

Comments (155)

alechkos avatar alechkos commented on May 24, 2024 37
const wwebVersion = '2.2412.54';

const client = new Client({
    authStrategy: new LocalAuth(), // your authstrategy here
    puppeteer: {
        // puppeteer args here
    },
    // locking the wweb version
    webVersionCache: {
        type: 'remote',
        remotePath: `https://raw.githubusercontent.com/wppconnect-team/wa-version/main/html/${wwebVersion}.html`,
    },
});

Relevant WWeb versions can be found here

from whatsapp-web.js.

Eonus avatar Eonus commented on May 24, 2024 17

Please don't close this issue because I took the time to find the specific place where this error occurs. I've searched through existing issues and not a single potential duplicate mentions a solution. My previous issue was closed without any clarifications about reasons for that.

from whatsapp-web.js.

adisutomo89 avatar adisutomo89 commented on May 24, 2024 17

Screenshot 2024-03-08 175934

I use LocalAuth every time I want to reload the cache, the error message always appears, please help me

SOLVED Use :

webVersionCache: {
type: 'remote',
remotePath: 'https://raw.githubusercontent.com/wppconnect-team/wa-version/main/html/2.2410.1.html',
}

from whatsapp-web.js.

micmil1977 avatar micmil1977 commented on May 24, 2024 14

Apparently they are moving from Webpack to some other framework called Comet.
In order to reproduce the problem and get the 2.3000 version that is based on Comet you need to add a cookie: wa_build=c
You can add it manually in DevTools and refresh the page.
Hopefully this will help someone to figure out how to find the modules under Comet.
As a temporary workaround for users that are already getting the Comet version, remove this cookie or change it to wa_build=w and refresh the page.

from whatsapp-web.js.

Kertis90 avatar Kertis90 commented on May 24, 2024 6

Is there any update or solution related to this issue?

from whatsapp-web.js.

videjunior avatar videjunior commented on May 24, 2024 5

Solved by putting the line below in Client.js:
Captura de Tela 2024-03-25 às 13 22 51

from whatsapp-web.js.

DRCHAZ avatar DRCHAZ commented on May 24, 2024 3

Any updates?
Still receiving this error.
After clearing session, reconnection of account passes couple of hours and error showing.

from whatsapp-web.js.

PurpShell avatar PurpShell commented on May 24, 2024 3

Hey everyone! I haven't noticed that the update already started rolling out. I'll be updating moduleRaid to support the new version, it is very simple!

from whatsapp-web.js.

ozkanydin avatar ozkanydin commented on May 24, 2024 3

Hi, I found a temporary solution .

The error

Error: Evaluation failed: TypeError: Cannot read properties of undefined (reading 'push')
    at fillModuleArray (eval at <anonymous> (:2:5), <anonymous>:6:74)
    at moduleRaid (eval at <anonymous> (:2:5), <anonymous>:15:3)
    at __puppeteer_evaluation_script__:4:17
    at ExecutionContext._evaluateInternal (/.../node_modules/puppeteer/lib/cjs/puppeteer/common/ExecutionContext.js:221:19)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async ExecutionContext.evaluate (/.../node_modules/puppeteer/lib/cjs/puppeteer/common/ExecutionContext.js:110:16)
    at async Client.initialize (/.../node_modules/whatsapp-web.js/src/Client.js:340:3)

at src/Client.js #339

await page.evaluate(ExposeStore, moduleRaid.toString());

.

The source code of WA is different when the browser is reloaded an there is a session. The new version 2.3.x.x set a cookie wa_build and these make the source code changes. ( @micmil1977 said it )

The solution is remove the cookie always. If the cookie was present when the puppeteer was loaded the page, delete cookie and reload it

The code:

await page.deleteCookie({name:'wa_build', domain:'.web.whatsapp.com', path:'/'});

I put it in all places i can because i don't know when the cookie is established.

Can you explain in a little more detail?

@pedroslopez We need your help, the problem persists

from whatsapp-web.js.

fififig avatar fififig commented on May 24, 2024 3

apparently WhatsApp has finally switched to Comet. Deleting cookies doesn't help, all accounts have this error

from whatsapp-web.js.

YisusCore avatar YisusCore commented on May 24, 2024 2

Hi, I found a temporary solution .
The error

Error: Evaluation failed: TypeError: Cannot read properties of undefined (reading 'push')
    at fillModuleArray (eval at <anonymous> (:2:5), <anonymous>:6:74)
    at moduleRaid (eval at <anonymous> (:2:5), <anonymous>:15:3)
    at __puppeteer_evaluation_script__:4:17
    at ExecutionContext._evaluateInternal (/.../node_modules/puppeteer/lib/cjs/puppeteer/common/ExecutionContext.js:221:19)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async ExecutionContext.evaluate (/.../node_modules/puppeteer/lib/cjs/puppeteer/common/ExecutionContext.js:110:16)
    at async Client.initialize (/.../node_modules/whatsapp-web.js/src/Client.js:340:3)

at src/Client.js #339

await page.evaluate(ExposeStore, moduleRaid.toString());

.
The source code of WA is different when the browser is reloaded an there is a session. The new version 2.3.x.x set a cookie wa_build and these make the source code changes. ( @micmil1977 said it )
The solution is remove the cookie always. If the cookie was present when the puppeteer was loaded the page, delete cookie and reload it
The code:

await page.deleteCookie({name:'wa_build', domain:'.web.whatsapp.com', path:'/'});

I put it in all places i can because i don't know when the cookie is established.

Can you explain in a little more detail?
@pedroslopez We need your help, the problem persists

The cookie make the source of the web changes:
the-cookie
The new source code with cookie
with-cookie
The old source code was loaded if the cookie is not present
without-cookie
I notice the cookie was setted after the auth is ready so i put the code:

class LocalAuth extends BaseAuthStrategy {
    ...
    async afterAuthReady() {
        const page = this.client.pupPage;
        await page.deleteCookie({name:'wa_build', domain:'.web.whatsapp.com', path:'/'});
    }
    ...
}

If the cookie is present in the line 339 on src/Client.js
image
I suggest execute the code and reload the Client.

await page.deleteCookie({name:'wa_build', domain:'.web.whatsapp.com', path:'/'});

Psdt: I used the commit 1.23.1-alpha.5

I do not suggest this method, as maybe whatsapp can detect that same client is going in a short way from old to new version and vice versa and this may lead to some bad classifications,

I prefer to work on supporting new version instead of keep running away from it

Its correct. For that I said is a temporary solution while we work on supporting 2.3xx completely.

from whatsapp-web.js.

maggnetz avatar maggnetz commented on May 24, 2024 2

in V2.3, when trying to send a message with error 'window.Store.MsgKey is not a constructor' any idea how to solve it? have you succeeded sending text message in V2.3?

any updates on this?

from whatsapp-web.js.

NissiusRibas avatar NissiusRibas commented on May 24, 2024 2

It didn't work here, I still get the error

usr/src/app/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 (/usr/src/app/node_modules/whatsapp-web.js/src/webCache/LocalWebCache.js:34:69)
at /usr/src/app/node_modules/whatsapp-web.js/src/Client.js:744:36
at processTicksAndRejections (node:internal/process/task_queues:96:5)

from whatsapp-web.js.

juaquinbab avatar juaquinbab commented on May 24, 2024 2

Hello,

const SESSION_FILE_PATH = './session.json';

let sessionData;

if (fs.existsSync(SESSION_FILE_PATH)) {
sessionData = require(SESSION_FILE_PATH);
}

const client = new Client({
puppeteer: {
executablePath: 'C:\Program Files\Google\Chrome\Application\chrome.exe',
args: ['--no-sandbox']
},
authStrategy: new LocalAuth({ clientId: "Client-one" }),
webVersionCache: {
type: 'remote',
remotePath: 'https://raw.githubusercontent.com/wppconnect-team/wa-version/main/html/2.2407.1.html'
}
});

client.on('qr', (qr) => {
qrcode.generate(qr, { small: true });
});

client.on('authenticated', (session) => {
console.log('Conexión exitosa');
sessionData = session;
if (sessionData) {
fs.writeFile(SESSION_FILE_PATH, JSON.stringify(session), (err) => {
if (err) {
console.error(err);
}
});
}
});

use it like this it works perfect, send messages, receive, send files, and save the session

from whatsapp-web.js.

juaquinbab avatar juaquinbab commented on May 24, 2024 2

After this Whatsapp sent a message saying that I was using an unofficial application and closed my WhatsApp, it did not block the line but it did close the account.

from whatsapp-web.js.

Eonus avatar Eonus commented on May 24, 2024 1

This is the line which cause the problem (https://github.com/pedroslopez/moduleRaid/blob/1867c12241b0d6200bd0d8dc852e875d95278ea3/moduleraid.js#L14):
image

from whatsapp-web.js.

ono77 avatar ono77 commented on May 24, 2024 1

How do you get wweb version 2.3000? Last version seems to be 2.2408

from whatsapp-web.js.

adisutomo89 avatar adisutomo89 commented on May 24, 2024 1

Screenshot 2024-03-08 175934

I use LocalAuth every time I want to reload the cache, the error message always appears, please help me

from whatsapp-web.js.

vitorsilveira93 avatar vitorsilveira93 commented on May 24, 2024 1

await page.deleteCookie({name:'wa_build',domain:'.web.whatsapp.com',path:'/'});

Solved by putting the line below in Client.js: Captura de Tela 2024-03-25 às 13 22 51

Funcionou para mim.

from whatsapp-web.js.

medeirosnvk avatar medeirosnvk commented on May 24, 2024 1

Olá,

const SESSION_FILE_PATH = './session.json';

deixe sessionData;

if (fs.existsSync(SESSION_FILE_PATH)) { sessionData = require(SESSION_FILE_PATH); }

cliente const = novo cliente ({ puppeteer: { executablePath: 'C:\Program Files\Google\Chrome\Application\chrome.exe', args: ['--no-sandbox'] }, authStrategy: new LocalAuth({ clientId : "Client-one" }), webVersionCache: { type: 'remote', remotePath: ' https://raw.githubusercontent.com/wppconnect-team/wa-version/main/html/2.2407.1.html ' } });

client.on('qr', (qr) => { qrcode.generate(qr, { small: true }); });

client.on('authenticated', (session) => { console.log('Conexión exitosa'); sessionData = session; if (sessionData) { fs.writeFile(SESSION_FILE_PATH, JSON.stringify(session), (err) = > { if (erro) { console.error(erro); } }); } });

use assim funciona perfeitamente, envie mensagens, receba, envie arquivos e salve a sessão

Thank you very much! It took a while, but it worked without having to scan the QRcode again. In my case I am using PM2 to restart the application.

from whatsapp-web.js.

ruiz-misael avatar ruiz-misael commented on May 24, 2024 1

316576037-c3998553-95dc-425a-98ad-ff14920c5fca

This worked for me by modifying the Client.js file

from whatsapp-web.js.

denikaryadi avatar denikaryadi commented on May 24, 2024 1

Hello,

const SESSION_FILE_PATH = './session.json';

let sessionData;

if (fs.existsSync(SESSION_FILE_PATH)) { sessionData = require(SESSION_FILE_PATH); }

const client = new Client({ puppeteer: { executablePath: 'C:\Program Files\Google\Chrome\Application\chrome.exe', args: ['--no-sandbox'] }, authStrategy: new LocalAuth({ clientId: "Client-one" }), webVersionCache: { type: 'remote', remotePath: 'https://raw.githubusercontent.com/wppconnect-team/wa-version/main/html/2.2407.1.html' } });

client.on('qr', (qr) => { qrcode.generate(qr, { small: true }); });

client.on('authenticated', (session) => { console.log('Conexión exitosa'); sessionData = session; if (sessionData) { fs.writeFile(SESSION_FILE_PATH, JSON.stringify(session), (err) => { if (err) { console.error(err); } }); } });

use it like this it works perfect, send messages, receive, send files, and save the session

Hello
after use this code with
const client = new Client({
puppeteer: { headless: false },
authStrategy: new LocalAuth({ clientId: "Client-one" }),
webVersionCache: {
type: 'remote',
remotePath: 'https://raw.githubusercontent.com/wppconnect-team/wa-version/main/html/2.2407.1.html'
}
});
this app, work for me.

from whatsapp-web.js.

MoudiZd avatar MoudiZd commented on May 24, 2024 1

@denikaryadi what file is this? @noobsmatr619 what folder? @MoudiZd I didn't understand your solution or workaround, I'm just trying to start whatsapp without issues.

Read the closed issue mentioned in my comment it contains the explanation of the issue and the title of some solutions and workarounds, but you can find the details about these solutions and workaround within pull requests and issues comments

Read every pull request and every issue , because the solution in current time is not included in one place as it is not based on one reason

If you want, you can join discord server, it has too many conversation about all new issues and about current status of the service

https://discord.gg/H7DqQs4

from whatsapp-web.js.

MiguelArgentina avatar MiguelArgentina commented on May 24, 2024 1

Hey folks, we are using RemoteAuth given that we have several sessions being managed by the same app.
has anybody been able to find a workaround for this problem? I has started happening today and it cannot start a sesion:

Session does not exist. Creating userDataDir...
extractRemoteSession completed.
beforeBrowserInitialized completed.
/home/ec2-user/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 (/home/ec2-user/whatsapp-web.js/src/webCache/LocalWebCache.js:34:69)
    at /home/ec2-user/whatsapp-web.js/src/Client.js:775:36
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
Node.js v18.18.2

from whatsapp-web.js.

DRCHAZ avatar DRCHAZ commented on May 24, 2024

Same problem last 3 days

from whatsapp-web.js.

DRCHAZ avatar DRCHAZ commented on May 24, 2024

Please help

from whatsapp-web.js.

DRCHAZ avatar DRCHAZ commented on May 24, 2024

As I see they are rolling out WhatsApp web v 2.3000 little by little, so bug need to be fixed.

from whatsapp-web.js.

Eonus avatar Eonus commented on May 24, 2024

I get this version from Client.getWWebVersion https://docs.wwebjs.dev/Client.html#getWWebVersion

from whatsapp-web.js.

alechkos avatar alechkos commented on May 24, 2024

Until the patch for wweb v2.3xxx is out use the webcache with wweb v2.2xxx
#1847
#2293 (comment)

Relevant wweb versions can be found here

from whatsapp-web.js.

rajeshshettysrs avatar rajeshshettysrs commented on May 24, 2024

Screenshot 2024-03-08 175934
I use LocalAuth every time I want to reload the cache, the error message always appears, please help me

SOLVED Use :

webVersionCache: { type: 'remote', remotePath: 'https://raw.githubusercontent.com/wppconnect-team/wa-version/main/html/2.2410.1.html', }

please share WAPI js file

from whatsapp-web.js.

tbsmark86 avatar tbsmark86 commented on May 24, 2024

The proposed workaround is not working for me but thanks for the push in the right direction. I changed it to a slightly older version:

    webVersionCache: {
                type: 'remote',
                remotePath: 'https://raw.githubusercontent.com/wppconnect-team/wa-version/main/html/2.2409.0.html',
            }

from whatsapp-web.js.

rajeshshettysrs avatar rajeshshettysrs commented on May 24, 2024

The proposed workaround is not working for me but thanks for the push in the right direction. I changed it to a slightly older version:

    webVersionCache: {
                type: 'remote',
                remotePath: 'https://raw.githubusercontent.com/wppconnect-team/wa-version/main/html/2.2409.0.html',
            }

Sir how to add in WAPI javascript file?

from whatsapp-web.js.

jaovitubr avatar jaovitubr commented on May 24, 2024

Aparentemente, eles estão mudando do Webpack para algum outro framework chamado Comet. Para reproduzir o problema e obter a versão 2.3000 que é baseada no Comet você precisa adicionar um cookie: wa_build=c Você pode adicioná-lo manualmente no DevTools e atualizar a página. Espero que isso ajude alguém a descobrir como encontrar os módulos sob o Cometa. Como uma solução temporária para usuários que já estão recebendo a versão do Cometa, remova esse cookie ou altere-o para wa_build=w e atualize a página.

What framework is this? link plz

from whatsapp-web.js.

tinyCoder32 avatar tinyCoder32 commented on May 24, 2024

Apparently they are moving from Webpack to some other framework called Comet. In order to reproduce the problem and get the 2.3000 version that is based on Comet you need to add a cookie: wa_build=c You can add it manually in DevTools and refresh the page. Hopefully this will help someone to figure out how to find the modules under Comet. As a temporary workaround for users that are already getting the Comet version, remove this cookie or change it to wa_build=w and refresh the page.

Not anymore, WhatsApp now immediately logs you out when you play with it.

from whatsapp-web.js.

frankdors avatar frankdors commented on May 24, 2024

Apparently they are moving from Webpack to some other framework called Comet. In order to reproduce the problem and get the 2.3000 version that is based on Comet you need to add a cookie: wa_build=c You can add it manually in DevTools and refresh the page. Hopefully this will help someone to figure out how to find the modules under Comet. As a temporary workaround for users that are already getting the Comet version, remove this cookie or change it to wa_build=w and refresh the page.

Here have a idea to get modules to new version...

Someone can help to convert moduleraid?
https://d33gom43gwygbg.cloudfront.net/utils/api.js

from whatsapp-web.js.

JL-Create avatar JL-Create commented on May 24, 2024

I've also encountered the same issue.
I found that when I use the WA APP version 2.24.4.78, the cache loads and works normally.
However, when I switch to using WA APP version 2.24.5.75, every time I try to load the cache, it always gives me this same error. My phone is an iPhone.

from whatsapp-web.js.

sergey-chechaev avatar sergey-chechaev commented on May 24, 2024

You can find fix here https://github.com/wppconnect-team/wa-js/pull/1726/files

The main idea to find modules in require('__debug').modulesMap

from whatsapp-web.js.

jaovitubr avatar jaovitubr commented on May 24, 2024

I created my own moduleRaid for my personal project, it was made to work with webpack and comet:

github.com/jaovitubr/moduleRaid

from whatsapp-web.js.

codeclass avatar codeclass commented on May 24, 2024

Still receiving this error

Error: Evaluation failed: TypeError: Cannot read properties of undefined (reading 'push')
    at fillModuleArray (eval at <anonymous> (:2:5), <anonymous>:6:74)
    at moduleRaid (eval at <anonymous> (:2:5), <anonymous>:15:3)
    at __puppeteer_evaluation_script__:4:17
    at ExecutionContext._evaluateInternal (/home/whatsapp/whatsapp/node_modules/puppeteer/lib/cjs/puppeteer/common/ExecutionContext.js:221:19)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async ExecutionContext.evaluate (/home/whatsapp/whatsapp/node_modules/puppeteer/lib/cjs/puppeteer/common/ExecutionContext.js:110:16)
    at async Client.initialize (/home/whatsapp/whatsapp/src/Client.js:339:9)

any solutions?

this not working

from whatsapp-web.js.

complanboy2 avatar complanboy2 commented on May 24, 2024

ModuleError: Requiring module "%s" with unresolved dependencies: %s

Getting this error

from whatsapp-web.js.

JL-Create avatar JL-Create commented on May 24, 2024

I've also encountered the same issue. I found that when I use the WA APP version 2.24.4.78, the cache loads and works normally. However, when I switch to using WA APP version 2.24.5.75, every time I try to load the cache, it always gives me this same error. My phone is an iPhone.

===================

After completing the following two steps, I resolved the issue

  1. alter src/util/Constants.js webVersion: '2.2410.1'
  2. alter const client = new Client({
    authStrategy: new LocalAuth(), // your authstrategy here
    puppeteer: {
    // puppeteer args here
    },
    webVersionCache: {
    type: 'remote',
    remotePath: https://raw.githubusercontent.com/wppconnect-team/wa-version/main/html/2.2410.1.html,
    },
    });

from whatsapp-web.js.

MoudiZd avatar MoudiZd commented on May 24, 2024

Any update on this? how to work around webpackChunkwhatsapp_web_client not being available on v2.3000?

A new pull request to the moduleRaid has been submitted and it must solve the issue with new version, take a look

wwebjs/moduleRaid#1

from whatsapp-web.js.

MoudiZd avatar MoudiZd commented on May 24, 2024

ModuleError: Requiring module "%s" with unresolved dependencies: %s

Getting this error

The reason of this error is that requiring modules is not wrapped within a try catch block, which generate a lot of errors

Also the error guard must be skipped temporarily while requiring modules as modules map contains a lot of modules that cannot and might not be required.

Anyway a new pull request to the moduleRaid has been submitted, you can check it here

wwebjs/moduleRaid#1

from whatsapp-web.js.

MoudiZd avatar MoudiZd commented on May 24, 2024

Still receiving this error

Error: Evaluation failed: TypeError: Cannot read properties of undefined (reading 'push')
    at fillModuleArray (eval at <anonymous> (:2:5), <anonymous>:6:74)
    at moduleRaid (eval at <anonymous> (:2:5), <anonymous>:15:3)
    at __puppeteer_evaluation_script__:4:17
    at ExecutionContext._evaluateInternal (/home/whatsapp/whatsapp/node_modules/puppeteer/lib/cjs/puppeteer/common/ExecutionContext.js:221:19)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async ExecutionContext.evaluate (/home/whatsapp/whatsapp/node_modules/puppeteer/lib/cjs/puppeteer/common/ExecutionContext.js:110:16)
    at async Client.initialize (/home/whatsapp/whatsapp/src/Client.js:339:9)

any solutions?

this not working

The default property is no longer existing in modules, so a workaround has been suggested in following pull request

wwebjs/moduleRaid#1

from whatsapp-web.js.

andrew-quicklution avatar andrew-quicklution commented on May 24, 2024

Thanks for the module Raid update. It worked for me.

Now it seems that we cannot send attachment because the createFromData function is not available in v2.3000. Can you confirm this?

window.Store.OpaqueData = window.mR.findModule(module => module.default && module.default.createFromData)[0].default;

const mData = await window.Store.OpaqueData.createFromData(file, file.type);

from whatsapp-web.js.

StiflerPasha avatar StiflerPasha commented on May 24, 2024

I can't get the module (with .default) at all. Use "new moduleRaid"
Снимок экрана 2024-03-19 130318

from whatsapp-web.js.

maunklana avatar maunklana commented on May 24, 2024

Check this PR 2825

Thanks for the module Raid update. It worked for me.

Now it seems that we cannot send attachment because the createFromData function is not available in v2.3000. Can you confirm this?

window.Store.OpaqueData = window.mR.findModule(module => module.default && module.default.createFromData)[0].default;

const mData = await window.Store.OpaqueData.createFromData(file, file.type);

from whatsapp-web.js.

maunklana avatar maunklana commented on May 24, 2024

is has change on structure, please check this PR 2825

I can't get the module (with .default) at all. Use "new moduleRaid"
Снимок экрана 2024-03-19 130318

from whatsapp-web.js.

anthonyvictor avatar anthonyvictor commented on May 24, 2024

Same error here

from whatsapp-web.js.

codeclass avatar codeclass commented on May 24, 2024

wwebjs/moduleRaid#1

Thanks
When I updated the moduleRaid, I started getting this error

Error: Evaluation failed: TypeError: Cannot read properties of undefined (reading 'default')
    at __puppeteer_evaluation_script__:5:95
    at ExecutionContext._evaluateInternal (/home/whatsapp/whatsapp/node_modules/puppeteer/lib/cjs/puppeteer/common/ExecutionContext.js:221:19)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async ExecutionContext.evaluate (/home/whatsapp/whatsapp/node_modules/puppeteer/lib/cjs/puppeteer/common/ExecutionContext.js:110:16)
    at async Client.initialize (/home/whatsapp/whatsapp/src/Client.js:339:9)

Then I updated the file Injected.js from the #2825 and everything worked

from whatsapp-web.js.

maggnetz avatar maggnetz commented on May 24, 2024

in V2.3, when trying to send a message with
error 'window.Store.MsgKey is not a constructor' any idea how to solve it?
have you succeeded sending text message in V2.3?

from whatsapp-web.js.

mouhammad-zd avatar mouhammad-zd commented on May 24, 2024

wwebjs/moduleRaid#1

Thanks When I updated the moduleRaid, I started getting this error

Error: Evaluation failed: TypeError: Cannot read properties of undefined (reading 'default')
    at __puppeteer_evaluation_script__:5:95
    at ExecutionContext._evaluateInternal (/home/whatsapp/whatsapp/node_modules/puppeteer/lib/cjs/puppeteer/common/ExecutionContext.js:221:19)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async ExecutionContext.evaluate (/home/whatsapp/whatsapp/node_modules/puppeteer/lib/cjs/puppeteer/common/ExecutionContext.js:110:16)
    at async Client.initialize (/home/whatsapp/whatsapp/src/Client.js:339:9)

Then I updated the file Injected.js from the #2825 and everything worked

This pr :
wwebjs/moduleRaid#1

has been created in order to not be obligated to change anything in injected.js, but as this pr has been created :
#2825

So the mentioned pr is not necessary anymore and i will close it

from whatsapp-web.js.

Dr-Horse avatar Dr-Horse commented on May 24, 2024

in V2.3, when trying to send a message with error 'window.Store.MsgKey is not a constructor' any idea how to solve it? have you succeeded sending text message in V2.3?

Same error here

from whatsapp-web.js.

willdotcom avatar willdotcom commented on May 24, 2024

Hello! i have this problem, anyone have how solve ?

image

from whatsapp-web.js.

MoudiZd avatar MoudiZd commented on May 24, 2024

Hello! i have this problem, anyone have how solve ?

image

It seems that you are trying to send a message to a contact which is not found within your chat list , can you confirm ?

from whatsapp-web.js.

willdotcom avatar willdotcom commented on May 24, 2024

¡Hola! Tengo este problema, ¿alguien tiene cómo solucionarlo?
imagen

Parece que está intentando enviar un mensaje a un contacto que no se encuentra dentro de su lista de chat, ¿puede confirmar?

Hello @MoudiZd No, the error appears after I scan the number to authenticate, which does not allow me to use it

from whatsapp-web.js.

YisusCore avatar YisusCore commented on May 24, 2024

Hi, I found a temporary solution .

The error

Error: Evaluation failed: TypeError: Cannot read properties of undefined (reading 'push')
    at fillModuleArray (eval at <anonymous> (:2:5), <anonymous>:6:74)
    at moduleRaid (eval at <anonymous> (:2:5), <anonymous>:15:3)
    at __puppeteer_evaluation_script__:4:17
    at ExecutionContext._evaluateInternal (/.../node_modules/puppeteer/lib/cjs/puppeteer/common/ExecutionContext.js:221:19)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async ExecutionContext.evaluate (/.../node_modules/puppeteer/lib/cjs/puppeteer/common/ExecutionContext.js:110:16)
    at async Client.initialize (/.../node_modules/whatsapp-web.js/src/Client.js:340:3)

at src/Client.js #339

await page.evaluate(ExposeStore, moduleRaid.toString());

.

The source code of WA is different when the browser is reloaded an there is a session.
The new version 2.3.x.x set a cookie wa_build and these make the source code changes.
( @micmil1977 said it )

The solution is remove the cookie always.
If the cookie was present when the puppeteer was loaded the page, delete cookie and reload it

The code:

await page.deleteCookie({name:'wa_build', domain:'.web.whatsapp.com', path:'/'});

I put it in all places i can because i don't know when the cookie is established.

from whatsapp-web.js.

MoudiZd avatar MoudiZd commented on May 24, 2024

¡Hola! Tengo este problema, ¿alguien tiene cómo solucionarlo?
imagen

Parece que está intentando enviar un mensaje a un contacto que no se encuentra dentro de su lista de chat, ¿puede confirmar?

Hello @MoudiZd No, the error appears after I scan the number to authenticate, which does not allow me to use it

Are you listening to any event related to reading messages? If yes, try to stop listening and check if it works

Actually many modules are changed and we need time to test everything to keep everything work on both versions

from whatsapp-web.js.

willdotcom avatar willdotcom commented on May 24, 2024

Hello @MoudiZd Thanks again for your response ❤️

Hello, no I really don't have anything listening or reading the messages, basically I just send messages, but this error occurs under these circumstances.

  • Add the number and try to scan the QR
  • Sometimes the QR code does not generate the crash, but when you disconnect the number it does.

It is quite strange and I don't know where the problem could come from or what the temporary fix would be.

from whatsapp-web.js.

MoudiZd avatar MoudiZd commented on May 24, 2024

Hello @MoudiZd Thanks again for your response ❤️

Hello, no I really don't have anything listening or reading the messages, basically I just send messages, but this error occurs under these circumstances.

  • Add the number and try to scan the QR
  • Sometimes the QR code does not generate the crash, but when you disconnect the number it does.

It is quite strange and I don't know where the problem could come from or what the temporary fix would be.

You are welcome 🤗

As we see in the picture and from the exception, that the error occured from downloadMedia method that is found within Message.js under src/structures/Message.js

Actually this method is used to download media from received messages

For that i assume that you are listening to received messages,
so when you scan the qrcode and the number start receiving unread messages, i assume that it encounters some media messages, and for that sometimes the number crashes (when there is some media messages that cannot be downloaded) not all the times

But we need more tests to confirm this.

Actually we are in a weird place now and many things has been changed, it is not about just changing from webpack to comet, but really i think that whatsapp has restructured their modules, i think that things will go clearer in next hours

from whatsapp-web.js.

MoudiZd avatar MoudiZd commented on May 24, 2024

Hi, I found a temporary solution .
The error

Error: Evaluation failed: TypeError: Cannot read properties of undefined (reading 'push')
    at fillModuleArray (eval at <anonymous> (:2:5), <anonymous>:6:74)
    at moduleRaid (eval at <anonymous> (:2:5), <anonymous>:15:3)
    at __puppeteer_evaluation_script__:4:17
    at ExecutionContext._evaluateInternal (/.../node_modules/puppeteer/lib/cjs/puppeteer/common/ExecutionContext.js:221:19)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async ExecutionContext.evaluate (/.../node_modules/puppeteer/lib/cjs/puppeteer/common/ExecutionContext.js:110:16)
    at async Client.initialize (/.../node_modules/whatsapp-web.js/src/Client.js:340:3)

at src/Client.js #339

await page.evaluate(ExposeStore, moduleRaid.toString());

.
The source code of WA is different when the browser is reloaded an there is a session. The new version 2.3.x.x set a cookie wa_build and these make the source code changes. ( @micmil1977 said it )
The solution is remove the cookie always. If the cookie was present when the puppeteer was loaded the page, delete cookie and reload it
The code:

await page.deleteCookie({name:'wa_build', domain:'.web.whatsapp.com', path:'/'});

I put it in all places i can because i don't know when the cookie is established.

Can you explain in a little more detail?

@pedroslopez We need your help, the problem persists

Before anything,
which wweb repo you are using?
and therefore which moduleRaid version , also which web whatsapp version?

The main branch of this repo, still just supporting web whatsapp version < 2.3 and does not work with new web whatsapp version

For the new web whatsapp version, maybe you can try the webpack-exodus branch, which has changed the moduleRaid version, that has been used in order to support comet which is used now instead of webpack,

also you may use this pr:
#2825 (comment)

As it is working on changing the way that we search about modules, because as i mentioned in my recent reply, that whatsapp is going to restructuring their modules, and we are not just in front of changing bundler from webpack to comet

Anyway keep your eyes on prs and issues , next hours sure will carry more improvements and more fixes

from whatsapp-web.js.

YisusCore avatar YisusCore commented on May 24, 2024

Hi, I found a temporary solution .
The error

Error: Evaluation failed: TypeError: Cannot read properties of undefined (reading 'push')
    at fillModuleArray (eval at <anonymous> (:2:5), <anonymous>:6:74)
    at moduleRaid (eval at <anonymous> (:2:5), <anonymous>:15:3)
    at __puppeteer_evaluation_script__:4:17
    at ExecutionContext._evaluateInternal (/.../node_modules/puppeteer/lib/cjs/puppeteer/common/ExecutionContext.js:221:19)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async ExecutionContext.evaluate (/.../node_modules/puppeteer/lib/cjs/puppeteer/common/ExecutionContext.js:110:16)
    at async Client.initialize (/.../node_modules/whatsapp-web.js/src/Client.js:340:3)

at src/Client.js #339

await page.evaluate(ExposeStore, moduleRaid.toString());

.
The source code of WA is different when the browser is reloaded an there is a session. The new version 2.3.x.x set a cookie wa_build and these make the source code changes. ( @micmil1977 said it )
The solution is remove the cookie always. If the cookie was present when the puppeteer was loaded the page, delete cookie and reload it
The code:

await page.deleteCookie({name:'wa_build', domain:'.web.whatsapp.com', path:'/'});

I put it in all places i can because i don't know when the cookie is established.

Can you explain in a little more detail?

@pedroslopez We need your help, the problem persists

The cookie make the source of the web changes:

the-cookie

The new source code with cookie

with-cookie

The old source code was loaded if the cookie is not present

without-cookie

I notice the cookie was setted after the auth is ready so i put the code:

class LocalAuth extends BaseAuthStrategy {
    ...
    async afterAuthReady() {
        const page = this.client.pupPage;
        await page.deleteCookie({name:'wa_build', domain:'.web.whatsapp.com', path:'/'});
    }
    ...
}

If the cookie is present in the line 339 on src/Client.js

image

I suggest execute the code and reload the Client.

await page.deleteCookie({name:'wa_build', domain:'.web.whatsapp.com', path:'/'});

Psdt: I used the commit 1.23.1-alpha.5

from whatsapp-web.js.

MoudiZd avatar MoudiZd commented on May 24, 2024

Hi, I found a temporary solution .
The error

Error: Evaluation failed: TypeError: Cannot read properties of undefined (reading 'push')
    at fillModuleArray (eval at <anonymous> (:2:5), <anonymous>:6:74)
    at moduleRaid (eval at <anonymous> (:2:5), <anonymous>:15:3)
    at __puppeteer_evaluation_script__:4:17
    at ExecutionContext._evaluateInternal (/.../node_modules/puppeteer/lib/cjs/puppeteer/common/ExecutionContext.js:221:19)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async ExecutionContext.evaluate (/.../node_modules/puppeteer/lib/cjs/puppeteer/common/ExecutionContext.js:110:16)
    at async Client.initialize (/.../node_modules/whatsapp-web.js/src/Client.js:340:3)

at src/Client.js #339

await page.evaluate(ExposeStore, moduleRaid.toString());

.
The source code of WA is different when the browser is reloaded an there is a session. The new version 2.3.x.x set a cookie wa_build and these make the source code changes. ( @micmil1977 said it )
The solution is remove the cookie always. If the cookie was present when the puppeteer was loaded the page, delete cookie and reload it
The code:

await page.deleteCookie({name:'wa_build', domain:'.web.whatsapp.com', path:'/'});

I put it in all places i can because i don't know when the cookie is established.

Can you explain in a little more detail?
@pedroslopez We need your help, the problem persists

The cookie make the source of the web changes:

the-cookie

The new source code with cookie

with-cookie

The old source code was loaded if the cookie is not present

without-cookie

I notice the cookie was setted after the auth is ready so i put the code:

class LocalAuth extends BaseAuthStrategy {
    ...
    async afterAuthReady() {
        const page = this.client.pupPage;
        await page.deleteCookie({name:'wa_build', domain:'.web.whatsapp.com', path:'/'});
    }
    ...
}

If the cookie is present in the line 339 on src/Client.js

image

I suggest execute the code and reload the Client.

await page.deleteCookie({name:'wa_build', domain:'.web.whatsapp.com', path:'/'});

Psdt: I used the commit 1.23.1-alpha.5

I do not suggest this method, as maybe whatsapp can detect that same client is going in a short way from old to new version and vice versa and this may lead to some bad classifications,

I prefer to work on supporting new version instead of keep running away from it

from whatsapp-web.js.

sgnm-ozkanaydin avatar sgnm-ozkanaydin commented on May 24, 2024

@MoudiZd I'm using 2.300 so it's invalid for me when will a solution come for 2.3

from whatsapp-web.js.

luiscuriel avatar luiscuriel commented on May 24, 2024

in V2.3, when trying to send a message with error 'window.Store.MsgKey is not a constructor' any idea how to solve it? have you succeeded sending text message in V2.3?

Same error here... any workaround pls?

from whatsapp-web.js.

luiscuriel avatar luiscuriel commented on May 24, 2024
const wwebVersion = '2.2407.3';

const client = new Client({
    authStrategy: new LocalAuth(), // your authstrategy here
    puppeteer: {
        // puppeteer args here
    },
    webVersionCache: {
        type: 'remote',
        remotePath: `https://raw.githubusercontent.com/wppconnect-team/wa-version/main/html/${wwebVersion}.html`,
    },
});

Relevant wweb versions can be found here

Worked for me.

That works, but forces me to recapture the QR, and I can't... any solution without forcing to recapture QR? thanks.

from whatsapp-web.js.

rodrigooliveira87 avatar rodrigooliveira87 commented on May 24, 2024

Resolvido colocando a linha abaixo em Client.js: Captura de Tela 2024-03-25 às 13 22 51

Does this resolve the 2.3X incompatibility definitively?

from whatsapp-web.js.

Tina4545 avatar Tina4545 commented on May 24, 2024

Solved by putting the line below in Client.js: Captura de Tela 2024-03-25 às 13 22 51

C:\Users\Administrator\Desktop\V35\node_modules\whatsapp-web.js\src\Client.js:107
await page.deleteCookie({name:'wa_build',domain:'.web.whatsapp.com',path:'/'});
^

TypeError: Cannot read properties of null (reading 'deleteCookie')
at Client.initialize (C:\Users\Administrator\Desktop\V35\node_modules\whatsapp-web.js\src\Client.js:107:24)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

Node.js v21.7.1

from whatsapp-web.js.

videjunior avatar videjunior commented on May 24, 2024

Resolvido colocando a linha abaixo em Client.js:Captura de Tela 2024-03-25 às 13 22 51

Isso resolve a incompatibilidade 2.3X definitivamente?

It works for me

from whatsapp-web.js.

videjunior avatar videjunior commented on May 24, 2024

Resolvido colocando a linha abaixo em Client.js:Captura de Tela 2024-03-25 às 13 22 51

C:\Usuários\Administrador\Desktop\V35\node_modules\whatsapp-web.js\src\Client.js:107 await page.deleteCookie({nome:'wa_build',domínio:'.web.whatsapp.com',caminho :'/'}); ^

TypeError: Não é possível ler propriedades de null (lendo 'deleteCookie') em Client.initialize (C:\Users\Administrator\Desktop\V35\node_modules\whatsapp-web.js\src\Client.js:107:24) no processo. processTicksAndRejections (nó: interno/processo/task_queues:95:5)

Node.js v21.7.1

It looks to me like your page object is null, check if your puppeteer browser is opening the page.

from whatsapp-web.js.

Tina4545 avatar Tina4545 commented on May 24, 2024

Resolvido colocando a linha abaixo em Client.js:Captura de Tela 2024-03-25 às 13 22 51

C:\Usuários\Administrador\Desktop\V35\node_modules\whatsapp-web.js\src\Client.js:107 await page.deleteCookie({nome:'wa_build',domínio:'.web.whatsapp.com',caminho :'/'}); ^
TypeError: Não é possível ler propriedades de null (lendo 'deleteCookie') em Client.initialize (C:\Users\Administrator\Desktop\V35\node_modules\whatsapp-web.js\src\Client.js:107:24) no processo. processTicksAndRejections (nó: interno/processo/task_queues:95:5)
Node.js v21.7.1

It looks to me like your page object is null, check if your puppeteer browser is opening the page.

its not opening because of that error

from whatsapp-web.js.

aashari avatar aashari commented on May 24, 2024

Solved by putting the line below in Client.js: Captura de Tela 2024-03-25 às 13 22 51

thanks, this one works perfectly on my side

from whatsapp-web.js.

Abhii-Agarwal09 avatar Abhii-Agarwal09 commented on May 24, 2024

Screenshot 2024-03-08 175934
I use LocalAuth every time I want to reload the cache, the error message always appears, please help me

SOLVED Use :

webVersionCache: { type: 'remote', remotePath: 'https://raw.githubusercontent.com/wppconnect-team/wa-version/main/html/2.2410.1.html', }

I used this solution. It worked fine for some time, then it blocked my number stating that the number violated the commerce policy of WhatsApp

from whatsapp-web.js.

rodrigooliveira87 avatar rodrigooliveira87 commented on May 24, 2024

Solved by putting the line below in Client.js: Captura de Tela 2024-03-25 às 13 22 51

It's working so far

from whatsapp-web.js.

juaquinbab avatar juaquinbab commented on May 24, 2024

It works well for me, it doesn't give me an error, but it doesn't save the session, it always generates the QR

from whatsapp-web.js.

aashari avatar aashari commented on May 24, 2024

Solved by putting the line below in Client.js: Captura de Tela 2024-03-25 às 13 22 51

thanks, this one works perfectly on my side

although it works for me, but keep in mind, I got warning message from whatsapp that my account is suspicious and will be inactive soon

from whatsapp-web.js.

medeirosnvk avatar medeirosnvk commented on May 24, 2024

Same problem, any solution please?

/home/deploy/api-whatsapp/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')

from whatsapp-web.js.

lucastabare avatar lucastabare commented on May 24, 2024

Hello, someone was able to find a solution to the problem, I tried with the answer of the partner, although the error no longer jumps, but I ask me to rescan the qr code.

from whatsapp-web.js.

rodrigooliveira87 avatar rodrigooliveira87 commented on May 24, 2024

Same problem, any solution please?

/home/deploy/api-whatsapp/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')

try this:

async persist(indexHtml) {
        // extract version from index (e.g. manifest-2.2206.9.json -> 2.2206.9)
        let version;
        if (indexHtml.match(/manifest-([\d\\.]+)\.json/) === null) {
            return null;
        } else {
            version = indexHtml.match(/manifest-([\d\\.]+)\.json/)[1];
        }
        if (!version) return;

        const filePath = path.join(this.path, `${version}.html`);
        fs.mkdirSync(this.path, { recursive: true });
        fs.writeFileSync(filePath, indexHtml);
    }

from whatsapp-web.js.

Tina4545 avatar Tina4545 commented on May 24, 2024

from whatsapp-web.js.

lucastabare avatar lucastabare commented on May 24, 2024

Hello,

const SESSION_FILE_PATH = './session.json';

let sessionData;

if (fs.existsSync(SESSION_FILE_PATH)) { sessionData = require(SESSION_FILE_PATH); }

const client = new Client({ puppeteer: { executablePath: 'C:\Program Files\Google\Chrome\Application\chrome.exe', args: ['--no-sandbox'] }, authStrategy: new LocalAuth({ clientId: "Client-one" }), webVersionCache: { type: 'remote', remotePath: 'https://raw.githubusercontent.com/wppconnect-team/wa-version/main/html/2.2407.1.html' } });

client.on('qr', (qr) => { qrcode.generate(qr, { small: true }); });

client.on('authenticated', (session) => { console.log('Conexión exitosa'); sessionData = session; if (sessionData) { fs.writeFile(SESSION_FILE_PATH, JSON.stringify(session), (err) => { if (err) { console.error(err); } }); } });

use it like this it works perfect, send messages, receive, send files, and save the session

sure, but I already scanned the qr before, I don't want to rescan it every time I have to send messages, before this error, the session was saved and worked every time I ran the method.

from whatsapp-web.js.

juaquinbab avatar juaquinbab commented on May 24, 2024

The session is saved, you do not have to scan it just 1 time.

The code goes in the app.js is how it is. saves and reads the saved session.

from whatsapp-web.js.

lucastabare avatar lucastabare commented on May 24, 2024

The session is saved, you do not have to scan it just 1 time.

The code goes in the app.js is how it is. saves and reads the saved session.

the session is saved at the first scan, but if I stop the application, it asks to scan the qr again.

from whatsapp-web.js.

juaquinbab avatar juaquinbab commented on May 24, 2024

I solved it with the code I provided, I saw that the problem was in how I called the saved session.

from whatsapp-web.js.

medeirosnvk avatar medeirosnvk commented on May 24, 2024

A sessão é salva, você não precisa digitalizá-la apenas uma vez.
O código vai no app.js é assim. salva e lê a sessão salva.

a sessão é salva na primeira varredura, mas se eu parar o aplicativo, ele pede para escanear o qr novamente.

Check if you are using LocalAuth like below:

const client = new Client({
authStrategy: new LocalAuth(),
puppeteer: {
// executablePath: "C:Program FilesGoogleChromeApplicationchrome.exe",
// headless: true,
args: ["--no-sandbox"],
},
webVersionCache: {
type: "remote",
remotePath:
"https://raw.githubusercontent.com/wppconnect-team/wa-version/main/html/2.2407.1.html",
},
});

from whatsapp-web.js.

lucastabare avatar lucastabare commented on May 24, 2024

it still does not work, I have multiple sessions saved, from several phones, in only some I have the problem that the index error pops up.
I tried your own solutions and it doesn't work, it keeps asking me to scan the qr when I already scanned it the previous time.

this is how I use it, every time I want to send messages, I send messages according to the phone id and based on that I look for the saved session in the root of the project.

const dataPath = path.resolve(__dirname, '../Sesiones');

const sessionState = ObtenerSesionWhatsapp(idTelefono);

if (!sessionState) {
    return res.status(400)
        .send('Disconect');
}

const whatsappClient = new Client({
    authStrategy: new LocalAuth({
        clientId: `cliente-${idTelefono}`,
        dataPath: dataPath,
    }),
    puppeteer: { headless: true },
    webVersionCache: {
        type: 'remote',
        remotePath: 'https://raw.githubusercontent.com/wppconnect-team/wa-version/main/html/2.2407.1.html'
    }
});

from whatsapp-web.js.

rahmandayub avatar rahmandayub commented on May 24, 2024

I solve the problem "Cannot read properties of null (reading '1')" by manually adding webVersion value match the .wwebjs_cache html version to the client
Screenshot from 2024-03-28 15-36-57

from whatsapp-web.js.

lucastabare avatar lucastabare commented on May 24, 2024

I solve the problem "Cannot read properties of null (reading '1')" by manually adding webVersion value match the .wwebjs_cache html version to the client Screenshot from 2024-03-28 15-36-57

if you have more than one active session, more than one html is created in the wwebjs_cache, how do you know which one corresponds to each one, or if you have more than one synchronized phone?

from whatsapp-web.js.

rahmandayub avatar rahmandayub commented on May 24, 2024

I solve the problem "Cannot read properties of null (reading '1')" by manually adding webVersion value match the .wwebjs_cache html version to the client Screenshot from 2024-03-28 15-36-57

if you have more than one active session, more than one html is created in the wwebjs_cache, how do you know which one corresponds to each one, or if you have more than one synchronized phone?

I am sorry, in my case just have one session active for now. I tried to place two version of html 2.2411.2 and latest 2.2412.50 and both can be used.

from whatsapp-web.js.

rodrigooliveira87 avatar rodrigooliveira87 commented on May 24, 2024

it still does not work, I have multiple sessions saved, from several phones, in only some I have the problem that the index error pops up. I tried your own solutions and it doesn't work, it keeps asking me to scan the qr when I already scanned it the previous time.

this is how I use it, every time I want to send messages, I send messages according to the phone id and based on that I look for the saved session in the root of the project.

const dataPath = path.resolve(__dirname, '../Sesiones');

const sessionState = ObtenerSesionWhatsapp(idTelefono);

if (!sessionState) {
    return res.status(400)
        .send('Disconect');
}

const whatsappClient = new Client({
    authStrategy: new LocalAuth({
        clientId: `cliente-${idTelefono}`,
        dataPath: dataPath,
    }),
    puppeteer: { headless: true },
    webVersionCache: {
        type: 'remote',
        remotePath: 'https://raw.githubusercontent.com/wppconnect-team/wa-version/main/html/2.2407.1.html'
    }
});

I had tried to use webVersionCache with external link like you with partial success. Removing it (webVersionCache) and editing Client.js to remove the cookie wa_build has being more effective

from whatsapp-web.js.

tdee912 avatar tdee912 commented on May 24, 2024

Solved by putting the line below in Client.js: Captura de Tela 2024-03-25 às 13 22 51

thanks,, work for me.

from whatsapp-web.js.

Tina4545 avatar Tina4545 commented on May 24, 2024

Hello,

const SESSION_FILE_PATH = './session.json';

let sessionData;

if (fs.existsSync(SESSION_FILE_PATH)) { sessionData = require(SESSION_FILE_PATH); }

const client = new Client({ puppeteer: { executablePath: 'C:\Program Files\Google\Chrome\Application\chrome.exe', args: ['--no-sandbox'] }, authStrategy: new LocalAuth({ clientId: "Client-one" }), webVersionCache: { type: 'remote', remotePath: 'https://raw.githubusercontent.com/wppconnect-team/wa-version/main/html/2.2407.1.html' } });

client.on('qr', (qr) => { qrcode.generate(qr, { small: true }); });

client.on('authenticated', (session) => { console.log('Conexión exitosa'); sessionData = session; if (sessionData) { fs.writeFile(SESSION_FILE_PATH, JSON.stringify(session), (err) => { if (err) { console.error(err); } }); } });

use it like this it works perfect, send messages, receive, send files, and save the session

where d i paste this code ??

from whatsapp-web.js.

ruiz-misael avatar ruiz-misael commented on May 24, 2024

some definitive solution?

from whatsapp-web.js.

ruiz-misael avatar ruiz-misael commented on May 24, 2024

I have two servers, one running Windows and the other running Ubuntu Server. I'm experiencing issues on Ubuntu, but not on Windows. I think that might be where the problem lies.

from whatsapp-web.js.

Tina4545 avatar Tina4545 commented on May 24, 2024

can someone connect via team viewer and help me solve the issue of session not being able to be picked when i rerun the code... im prepared to pay you if u solve my whatsapp +263785866344

from whatsapp-web.js.

MoudiZd avatar MoudiZd commented on May 24, 2024

can someone connect via team viewer and help me solve the issue of session not being able to be picked when i rerun the code... im prepared to pay you if u solve my whatsapp +263785866344

Read more here :

#2856

from whatsapp-web.js.

MoudiZd avatar MoudiZd commented on May 24, 2024

hello i opened this :
#2856
and wrapped up everything related to the current discussed issue, from causes to technical details to workarounds in one place, please keep it open

from whatsapp-web.js.

noobsmatr619 avatar noobsmatr619 commented on May 24, 2024

#1795 (comment)
removing the session worked for me, according to the comment above

from whatsapp-web.js.

xx7Ahmed7xx avatar xx7Ahmed7xx commented on May 24, 2024

@denikaryadi what file is this?
@noobsmatr619 what folder?
@MoudiZd I didn't understand your solution or workaround, I'm just trying to start whatsapp without issues.

from whatsapp-web.js.

timesrunaway avatar timesrunaway commented on May 24, 2024

Apparently they are moving from Webpack to some other framework called Comet. In order to reproduce the problem and get the 2.3000 version that is based on Comet you need to add a cookie: wa_build=c You can add it manually in DevTools and refresh the page. Hopefully this will help someone to figure out how to find the modules under Comet. As a temporary workaround for users that are already getting the Comet version, remove this cookie or change it to wa_build=w and refresh the page.

not work now

from whatsapp-web.js.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.