错误:评估失败:TypeError:无法读取未定义的属性(读取’CallCollection’)

huangapple go评论143阅读模式
英文:

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

  1. const client = new Client({
  2. authStrategy: new LocalAuth(),
  3. puppeteer: {
  4. headless: true,
  5. args: [
  6. '--no-default-browser-check',
  7. '--disable-session-crashed-bubble',
  8. '--disable-dev-shm-usage',
  9. '--no-sandbox',
  10. '--disable-setuid-sandbox',
  11. '--disable-accelerated-2d-canvas',
  12. '--no-first-run',
  13. ],
  14. takeoverOnConflict: true,
  15. }
  16. });

package.json

  1. "dependencies": {
  2. "axios": "^1.4.0",
  3. "cors": "^2.8.5",
  4. "dotenv": "^16.3.1",
  5. "express": "^4.18.2",
  6. "nodemon": "^2.0.22",
  7. "qrcode": "^1.5.3",
  8. "qrcode-terminal": "^0.12.0",
  9. "whatsapp-web.js": "^1.21.0"
  10. }

the error is:

  1. Error: Evaluation failed: TypeError: Cannot read properties of undefined (reading 'CallCollection')
  2. at __puppeteer_evaluation_script__:9:66
  3. 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)
  4. at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
  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)
  6. 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

  1. const client = new Client({
  2. authStrategy: new LocalAuth(),
  3. puppeteer: {
  4. headless: true,
  5. args: [
  6. '--no-default-browser-check',
  7. '--disable-session-crashed-bubble',
  8. '--disable-dev-shm-usage',
  9. '--no-sandbox',
  10. '--disable-setuid-sandbox',
  11. '--disable-accelerated-2d-canvas',
  12. '--no-first-run',
  13. ],
  14. takeoverOnConflict: true,
  15. }
  16. });

package.json

  1. "dependencies": {
  2. "axios": "^1.4.0",
  3. "cors": "^2.8.5",
  4. "dotenv": "^16.3.1",
  5. "express": "^4.18.2",
  6. "nodemon": "^2.0.22",
  7. "qrcode": "^1.5.3",
  8. "qrcode-terminal": "^0.12.0",
  9. "whatsapp-web.js": "^1.21.0"
  10. }

the error is:

<!-- language: none -->

  1. Error: Evaluation failed: TypeError: Cannot read properties of undefined (reading &#39;CallCollection&#39;)
  2. at __puppeteer_evaluation_script__:9:66
  3. 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)
  4. at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
  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)
  6. 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:

  1. 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:

  1. npm i whatsapp-web.js@1.21.1-alpha.1

Related links:

huangapple
  • 本文由 发表于 2023年8月10日 10:11:17
  • 转载请务必保留本文链接:https://go.coder-hub.com/76872244.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定