英文:
Error: Evaluation failed: TypeError: Cannot read properties of undefined (reading 'CallCollection')
问题
I try to scan my QR to start the session, but it is showing the following error every time.
index.js
const client = new Client({
authStrategy: new LocalAuth(),
puppeteer: {
headless: true,
args: [
'--no-default-browser-check',
'--disable-session-crashed-bubble',
'--disable-dev-shm-usage',
'--no-sandbox',
'--disable-setuid-sandbox',
'--disable-accelerated-2d-canvas',
'--no-first-run',
],
takeoverOnConflict: true,
}
});
package.json
"dependencies": {
"axios": "^1.4.0",
"cors": "^2.8.5",
"dotenv": "^16.3.1",
"express": "^4.18.2",
"nodemon": "^2.0.22",
"qrcode": "^1.5.3",
"qrcode-terminal": "^0.12.0",
"whatsapp-web.js": "^1.21.0"
}
the error is:
Error: Evaluation failed: TypeError: Cannot read properties of undefined (reading 'CallCollection')
at __puppeteer_evaluation_script__:9:66
at ExecutionContext._evaluateInternal (C:\Users\I836659\Documents\MRPBot\ChatPedicure\node_modules\whatsapp-web.js\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 (C:\Users\I836659\Documents\MRPBot\ChatPedicure\node_modules\whatsapp-web.js\node_modules\puppeteer\lib\cjs\puppeteer\common\ExecutionContext.js:110:16)
at async Client.initialize (C:\Users\I836659\Documents\MRPBot\ChatPedicure\node_modules\whatsapp-web.js\src\Client.js:278:9)
Hope this helps! If you have any more questions or need further assistance, please let me know.
英文:
I try to scan my QR to start the session, but it is showing the following error every time.
index.js
const client = new Client({
authStrategy: new LocalAuth(),
puppeteer: {
headless: true,
args: [
'--no-default-browser-check',
'--disable-session-crashed-bubble',
'--disable-dev-shm-usage',
'--no-sandbox',
'--disable-setuid-sandbox',
'--disable-accelerated-2d-canvas',
'--no-first-run',
],
takeoverOnConflict: true,
}
});
package.json
"dependencies": {
"axios": "^1.4.0",
"cors": "^2.8.5",
"dotenv": "^16.3.1",
"express": "^4.18.2",
"nodemon": "^2.0.22",
"qrcode": "^1.5.3",
"qrcode-terminal": "^0.12.0",
"whatsapp-web.js": "^1.21.0"
}
the error is:
<!-- language: none -->
Error: Evaluation failed: TypeError: Cannot read properties of undefined (reading 'CallCollection')
at __puppeteer_evaluation_script__:9:66
at ExecutionContext._evaluateInternal (C:\Users\I836659\Documents\MRPBot\ChatPedicure\node_modules\whatsapp-web.js\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 (C:\Users\I836659\Documents\MRPBot\ChatPedicure\node_modules\whatsapp-web.js\node_modules\puppeteer\lib\cjs\puppeteer\common\ExecutionContext.js:110:16)
at async Client.initialize (C:\Users\I836659\Documents\MRPBot\ChatPedicure\node_modules\whatsapp-web.js\src\Client.js:278:9)
答案1
得分: 2
1.21.0是一个有问题的版本。在新的稳定主要版本发布之前,尝试更新到版本1.21.1-alpha.1,根据whatsapp-web.js问题2388的评论中的建议。
如果你使用npm:
npm i whatsapp-web.js@1.21.1-alpha.1
相关链接:
英文:
1.21.0 is a broken release. As a workaround until a new stable major release is out, try updating to version 1.21.1-alpha.1, based on a comment in whatsapp-web.js issue #2388.
If you're using npm:
npm i whatsapp-web.js@1.21.1-alpha.1
Related links:
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论