wppconnect-team / wppconnect

WPPConnect is an open source project developed by the JavaScript community with the aim of exporting functions from WhatsApp Web to the node, which can be used to support the creation of any interaction, such as customer service, media sending, intelligence recognition based on phrases artificial and many other things, use your imagination
https://wppconnect.io
Other
1.77k stars 304 forks source link

`wapi.js injected` several times #2206

Closed renandecarlo closed 3 weeks ago

renandecarlo commented 3 weeks ago

Description

It seems the current default wpp version 2.3000.1013232587-alpha causes the wapi.js to be injected several times at the first sync, leading to error in sent messages. After a restart, it works fine.

It seems to be fixed by updating the wpp version to newer versions, or using whatsappVersion: null

ALSO: It seems wa-version is no longer generating main and beta wpp versions, just alpha ones

Environment

Saifallak commented 3 weeks ago

+1

sandro-salles commented 3 weeks ago

+1

sandro-salles commented 3 weeks ago

@renandecarlo still having issues on Ubuntu 22.04, even after setting that version manually.

Environment WPPConnect version(s): 1.31.0 WA-JS version(s): 3.3.1 Browser: Chrome 125.0.6422.141 OS: Ubuntu 22.04 Node version: v18.19.1 WhatsApp version: 2.3000.1014090025-alpha

Puppeteer versions: "puppeteer": "^22.10.0", "puppeteer-extra": "^3.3.6", "puppeteer-extra-plugin-stealth": "^2.11.2", "puppeteer-extra-plugin-user-data-dir": "^2.4.1", "puppeteer-extra-plugin-user-preferences": "^2.4.1",

WhatsApp Image 2024-06-11 at 10 02 59

Anyone?

renandecarlo commented 3 weeks ago

@sandro-salles you have to delete the tokens folder after editing the wpp version

sandro-salles commented 3 weeks ago

@renandecarlo already did that.. multiple times. no help...

Using headless false, i can see that the instance is in fact authenticated:

WhatsApp Image 2024-06-11 at 10 12 11

Bu the process hangs for some time as Waiting page load and then i can see some exceptions in the console:

WhatsApp Image 2024-06-11 at 10 11 28

renandecarlo commented 3 weeks ago

@sandro-salles i'm not sure then, maybe try an older version like 2.3000.1013710920-alpha or whatsappVersion: null It works for me with a bare minimum wppconnect instance on Windows 10

const wppconnect = require('@wppconnect-team/wppconnect');

(async () => {
    try {
        wppconnect.defaultLogger.level = 'silly';

        const client = await wppconnect.create({
            session: 'wpp-session', 
            headless: false, 
            whatsappVersion: '2.3000.1013710920-alpha',
        });
    } catch(e) {
        console.error('-> Não foi possível inicializar o Whatsapp Web', e);
    }
})()

2024-06-11 10_46_14-Window

ademirMess commented 3 weeks ago

+1

gekkedev commented 3 weeks ago

@Saifallak @sandro-salles @ademirMess if you want to say "plus 1" you can just react with a thumbs up. GitHub even hides repetitive replies.

icleitoncosta commented 3 weeks ago

Hey, please test this PR: https://github.com/wppconnect-team/wppconnect/pull/2215