Describe the bug
Can't start sulla with the example code on Readme.
Steps to Reproduce
Steps to reproduce the behavior:
create() code
This is the code you use to create the client. e.g
const sulla = require('sulla-hotfix');
sulla.create().then(client => start(client));
function start(client) {
client.onMessage(message => {
if (message.body === 'Hi') {
client.sendText(message.from, '👋 Hello from sulla!');
}
});
}
Expected behavior
I was expecting the regular result, that the code generate the QR code.
DEBUG INFO
node start.js
â ¸ Initializing whatsapp(node:30455) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'sessionData' of undefined
at Object.<anonymous> (/home/dr4gon/Desktop/chatbot/node_modules/sulla-hotfix/dist/controllers/browser.js:115:59)
at step (/home/dr4gon/Desktop/chatbot/node_modules/sulla-hotfix/dist/controllers/browser.js:44:23)
at Object.next (/home/dr4gon/Desktop/chatbot/node_modules/sulla-hotfix/dist/controllers/browser.js:25:53)
at fulfilled (/home/dr4gon/Desktop/chatbot/node_modules/sulla-hotfix/dist/controllers/browser.js:16:58)
at process._tickCallback (internal/process/next_tick.js:68:7)
(node:30455) 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(). (rejection id: 1)
(node:30455) [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.
â ¼ Initializing whatsapp
Debug Info {
WA_VERSION: ...,
PAGE_UA: ...,
SULLA_HOTFIX_VERSION: 1.8.18,
BROWSER_VERSION: Google Chrome Version 80.0.3987.132 (Official Build) (64-bit) STANDARD BROWSER
Chromium Version 80.0.3987.132 (Official Build) snap (64-bit)
Firefox 74.0 (64-bit)
}
Screenshots
none
Host (please complete the following information):
Additional context
package.json
{
"name": "chatbot",
"version": "1.0.0",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC",
"description": "",
"dependencies": {
"sharp": "^0.25.1",
"sulla-hotfix": "^1.8.18"
}
}
@scoorpionx thanks for filling the template properly.
I can see the problem and will issue a fix soon. In the meantime can you try this:
...
sulla.create('session',{})...
...
That work for me, thanks.
Can you explain to me whats causin' that and where did you find the problem?
sessionData is being checked on an undefined object.
@github-actions run
âš¡ Release! âš¡
(async () => {
function exec(cmd) {
console.log(execSync(cmd).toString());
}
// Config
const gitUserEmail = "github-actions[bot]@users.noreply.github.com";
const gitUserName = "github-actions[bot]";
exec(`echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > .npmrc`);
exec(`git config --global user.email "${gitUserEmail}"`);
exec(`git config --global user.name "${gitUserName}"`);
exec(`npm i`);
exec(`npm run release-ci`);
var result = execSync(`npx auto-changelog -o ./tempchangelog.txt --commit-limit false --template ./compact-keepachangelog.hbs --stdout`).toString();
await postComment(result);
})();
@scoorpionx can you check with latest version + original set up and confirm it's working, please. thanks.
Its working.
Thanks.