WECHATY_PUPPET=mock failed, TypeError [ERR_INVALID_ARG_TYPE]: The "request" argument must be of type string
Created by: suntong
This is a follow up from, https://github.com/Chatie/wechaty-puppet-puppeteer/issues/60 in which all the relevant environment/install/config/running info is given.
I.e., under a fresh installation, the mock puppet is not working either:
$ WECHATY_PUPPET=mock node starter-bot.js
12:26:38 INFO Wechaty <mock> start() v0.22.6 is starting...
12:26:38 INFO PuppetManager install(mock@latest) please wait ...
npm: + mock@0.1.1
added 1 package from 2 contributors and audited 65 packages in 1.701s
npm: found 0 vulnerabilities
12:26:41 INFO PuppetManager install(mock@latest) done
TypeError [ERR_INVALID_ARG_TYPE]: The "request" argument must be of type string. Received type undefined
at validateString (internal/validators.js:125:11)
at Function.resolve (internal/modules/cjs/helpers.js:29:5)
at new mock (/path/to/wechaty-getting-started/node_modules/wechaty/node_modules/mock/index.js:15:29)
at Function.<anonymous> (/path/to/wechaty-getting-started/node_modules/wechaty/dist/src/puppet-manager.js:58:34)
at Generator.next (<anonymous>)
at fulfilled (/path/to/wechaty-getting-started/node_modules/wechaty/dist/src/puppet-manager.js:4:58)
12:26:41 ERR Wechaty start() exception: The "request" argument must be of type string. Received type undefined
TypeError [ERR_INVALID_ARG_TYPE]: The "request" argument must be of type string. Received type undefined
at validateString (internal/validators.js:125:11)
at Function.resolve (internal/modules/cjs/helpers.js:29:5)
at new mock (/path/to/wechaty-getting-started/node_modules/wechaty/node_modules/mock/index.js:15:29)
at Function.<anonymous> (/path/to/wechaty-getting-started/node_modules/wechaty/dist/src/puppet-manager.js:58:34)
at Generator.next (<anonymous>)
at fulfilled (/path/to/wechaty-getting-started/node_modules/wechaty/dist/src/puppet-manager.js:4:58)
Full Output Logs
Show Logs
$ WECHATY_LOG=silly WECHATY_PUPPET=mock node starter-bot.js
12:31:43 SILL Config WECHATY_LOG set level to silly
12:31:43 INFO Config registering process.on("unhandledRejection") for development/debug
12:31:43 VERB Config constructor()
12:31:43 SILL Accessory #0<Wechaty> constructor()
12:31:43 VERB Wechaty contructor()
12:31:43 VERB StateSwitch constructor(name=Wechaty)
12:31:43 VERB StateSwitch constructor(name=WechatyReady)
12:31:43 VERB Wechaty on(scan, function) registered
12:31:43 VERB Wechaty onFunction(scan)
12:31:43 VERB Wechaty on(login, function) registered
12:31:43 VERB Wechaty onFunction(login)
12:31:43 VERB Wechaty on(logout, function) registered
12:31:43 VERB Wechaty onFunction(logout)
12:31:43 VERB Wechaty on(message, function) registered
12:31:43 VERB Wechaty onFunction(message)
12:31:43 SILL Wechaty version() form development environment is not availble: ENOENT: no such file or directory, stat '/path/to/wechaty-getting-started/node_modules/wechaty/dist/.git'
12:31:43 INFO Wechaty <mock> start() v0.22.6 is starting...
12:31:43 VERB Wechaty puppet: undefined
12:31:43 VERB Wechaty profile: undefined
12:31:43 VERB Wechaty id: cjpzqqlsv0000c6fu7syky21h
12:31:43 SILL StateSwitch <Wechaty> on() is false
12:31:43 SILL StateSwitch <WechatyReady> off() is true
12:31:43 VERB StateSwitch <WechatyReady> off(true) <- (true)
12:31:43 SILL StateSwitch <Wechaty> on() is false
12:31:43 VERB StateSwitch <Wechaty> on(pending) <- (false)
12:31:43 VERB MemoryCard constructor(undefined)
12:31:43 VERB MemoryCard getStorage() for storage type: N/A
12:31:43 VERB MemoryCard load() from storage: N/A
12:31:43 VERB MemoryCard load() no storage
12:31:43 VERB Wechaty initPuppet()
12:31:43 VERB MemoryCard multiplex(puppet)
12:31:43 VERB MemoryCard static multiplex(MemoryCard<>, puppet)
12:31:43 VERB MemoryCard constructor({"multiplex":{"name":"puppet","parent":{"payload":{},"multiplexNameList":[]}}})
12:31:43 VERB PuppetManager resolve({wechaty: Wechaty#cjpzqqlsv0000c6fu7syky21h<>(), puppet: mock, puppetOptions: undefined})
12:31:43 VERB PuppetManager resolveName(mock)
12:31:43 VERB PuppetManager checkModule(mock)
12:31:43 SILL PuppetManager checkModule() mock installed version 0.1.1 NOT satisfied range undefined
12:31:43 INFO PuppetManager install(mock@latest) please wait ...
npm: + mock@0.1.1
updated 1 package and audited 65 packages in 1.702s
npm: found 0 vulnerabilities
12:31:46 INFO PuppetManager install(mock@latest) done
TypeError [ERR_INVALID_ARG_TYPE]: The "request" argument must be of type string. Received type undefined
at validateString (internal/validators.js:125:11)
at Function.resolve (internal/modules/cjs/helpers.js:29:5)
at new mock (/path/to/wechaty-getting-started/node_modules/wechaty/node_modules/mock/index.js:15:29)
at Function.<anonymous> (/path/to/wechaty-getting-started/node_modules/wechaty/dist/src/puppet-manager.js:58:34)
at Generator.next (<anonymous>)
at fulfilled (/path/to/wechaty-getting-started/node_modules/wechaty/dist/src/puppet-manager.js:4:58)
12:31:46 ERR Wechaty start() exception: The "request" argument must be of type string. Received type undefined
TypeError [ERR_INVALID_ARG_TYPE]: The "request" argument must be of type string. Received type undefined
at validateString (internal/validators.js:125:11)
at Function.resolve (internal/modules/cjs/helpers.js:29:5)
at new mock (/path/to/wechaty-getting-started/node_modules/wechaty/node_modules/mock/index.js:15:29)
at Function.<anonymous> (/path/to/wechaty-getting-started/node_modules/wechaty/dist/src/puppet-manager.js:58:34)
at Generator.next (<anonymous>)
at fulfilled (/path/to/wechaty-getting-started/node_modules/wechaty/dist/src/puppet-manager.js:4:58)