wechaty / puppet-wechat

Wechaty Puppet Provider for WeChat
https://www.npmjs.com/package/wechaty-puppet-wechat
Apache License 2.0
417 stars 71 forks source link

执行demo.ts报错 #125

Closed stoneLee81 closed 3 years ago

stoneLee81 commented 3 years ago

在wechaty-puppet-puppeteer目录下,执行 WECHATY_PUPPET_PUPPETEER_STEALTHLESS=1 ts-node examples/demo.ts 命令,报错:

(node:11521) UnhandledPromiseRejectionWarning: ReferenceError: status is not defined
    at PuppetPuppeteer.onScan (/Volumes/data/wechat/wechaty-puppet-puppeteer/examples/demo.ts:76:22)
    at PuppetPuppeteer.emit (events.js:327:22)
    at PuppetPuppeteer.EventEmitter.emit (domain.js:467:12)
    at PuppetPuppeteer.emit (/Volumes/data/wechat/wechaty-puppet-puppeteer/node_modules/wechaty-puppet/src/puppet.ts:307:18)
    at PuppetPuppeteer.onScan (/Volumes/data/wechat/wechaty-puppet-puppeteer/src/event.ts:107:8)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:11521) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:11521) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
(node:11521) UnhandledPromiseRejectionWarning: ReferenceError: status is not defined
    at PuppetPuppeteer.onScan (/Volumes/data/wechat/wechaty-puppet-puppeteer/examples/demo.ts:76:22)
    at PuppetPuppeteer.emit (events.js:327:22)
    at PuppetPuppeteer.EventEmitter.emit (domain.js:467:12)
    at PuppetPuppeteer.emit (/Volumes/data/wechat/wechaty-puppet-puppeteer/node_modules/wechaty-puppet/src/puppet.ts:307:18)
    at PuppetPuppeteer.onScan (/Volumes/data/wechat/wechaty-puppet-puppeteer/src/event.ts:107:8)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
(node:11521) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2)
huan commented 3 years ago

Please use our wechaty-getting-started repo at https://github.com/wechaty/wechaty-getting-started

And read those two blog posts might be helpful to you:

  1. https://wechaty.js.org/2021/02/20/google-cloud-shell-tutorials/
  2. https://wechaty.js.org/2021/02/06/wechaty-getting-started-without-leave-your-browser/
huan commented 3 years ago

The latest commit should fix this problem. Thanks for reporting!