Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wapi.js injected several times #2206

Closed
renandecarlo opened this issue Jun 11, 2024 · 9 comments · May be fixed by JEduardo-Monti/bot-whatsapp#2 or JEduardo-Monti/bot-whatsapp#4
Closed

wapi.js injected several times #2206

renandecarlo opened this issue Jun 11, 2024 · 9 comments · May be fixed by JEduardo-Monti/bot-whatsapp#2 or JEduardo-Monti/bot-whatsapp#4
Labels
bug Something isn't working needs triage

Comments

@renandecarlo
Copy link
Contributor

renandecarlo commented Jun 11, 2024

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

  • WPPConnect version(s): 1.31.0
  • WA-JS version(s): 3.3.1
  • Browser: Chrome 125
  • OS: Windows 10
  • Node version: Node 18
  • WhatsApp version: 2.3000.1013232587-alpha
@renandecarlo renandecarlo added bug Something isn't working needs triage labels Jun 11, 2024
@Saifallak

This comment was marked as off-topic.

1 similar comment
@sandro-salles
Copy link

+1

renandecarlo added a commit to renandecarlo/wppconnect that referenced this issue Jun 11, 2024
@sandro-salles
Copy link

@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
Copy link
Contributor Author

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

@sandro-salles
Copy link

@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
Copy link
Contributor Author

renandecarlo commented Jun 11, 2024

@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
Copy link

+1

@gekkedev
Copy link
Contributor

@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
Copy link
Contributor

Hey, please test this PR:
#2215

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment