You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
SyntaxError: Unexpected token ':'
at ModuleLoader.moduleStrategy (node:internal/modules/esm/translators:167:18)
at callTranslator (node:internal/modules/esm/loader:285:14)
at ModuleLoader.moduleProvider (node:internal/modules/esm/loader:291:30)
at async link (node:internal/modules/esm/module_job:76:21)
D:\AI\DingDongBot>node dingdongbot.js
file:///D:/AI/DingDongBot/dingdongbot.js:20
function onScan (qrcode: string, status: ScanStatus) {
^
SyntaxError: Unexpected token ':'
at ModuleLoader.moduleStrategy (node:internal/modules/esm/translators:167:18)
at callTranslator (node:internal/modules/esm/loader:285:14)
at ModuleLoader.moduleProvider (node:internal/modules/esm/loader:291:30)
at async link (node:internal/modules/esm/module_job:76:21)
Node.js v20.11.0
D:\AI\DingDongBot>node -v
v20.11.0
D:\AI\DingDongBot>npm -v
10.2.4
this is the code same as the example
function onScan (qrcode: string, status: ScanStatus) {
if (status === ScanStatus.Waiting || status === ScanStatus.Timeout) {
const qrcodeImageUrl = [
'https://wechaty.js.org/qrcode/',
encodeURIComponent(qrcode),
].join('')
log.info('StarterBot', 'onScan: %s(%s) - %s', ScanStatus[status], status, qrcodeImageUrl)
} else {
log.info('StarterBot', 'onScan: %s(%s)', ScanStatus[status], status)
}
}
The text was updated successfully, but these errors were encountered: