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

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

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 &#39;CallCollection&#39;)
    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:

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:

确定