Wa-automate-nodejs: Error on initialize

Created on 10 Mar 2020  ·  10Comments  ·  Source: open-wa/wa-automate-nodejs

Describe the bug
Can't start sulla.

Steps to Reproduce
I've installed sulla-hotfix with npm and just paste the main code like it is and just doens't start.
I'm using Ubuntu 19.10 and never could use sulla-hotfix, only sulla.

Follow the error on the terminal:

⠸ Initializing whatsapp(node:24800) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'browser' of undefined
    at /home/dr4gon/Documents/chatbot3/node_modules/sulla-hotfix/dist/controllers/initializer.js:253:29
    at step (/home/dr4gon/Documents/chatbot3/node_modules/sulla-hotfix/dist/controllers/initializer.js:33:23)
    at Object.next (/home/dr4gon/Documents/chatbot3/node_modules/sulla-hotfix/dist/controllers/initializer.js:14:53)
    at /home/dr4gon/Documents/chatbot3/node_modules/sulla-hotfix/dist/controllers/initializer.js:8:71
    at new Promise (<anonymous>)
    at __awaiter (/home/dr4gon/Documents/chatbot3/node_modules/sulla-hotfix/dist/controllers/initializer.js:4:12)
    at kill (/home/dr4gon/Documents/chatbot3/node_modules/sulla-hotfix/dist/controllers/initializer.js:240:33)
    at Object.<anonymous> (/home/dr4gon/Documents/chatbot3/node_modules/sulla-hotfix/dist/controllers/initializer.js:230:32)
    at step (/home/dr4gon/Documents/chatbot3/node_modules/sulla-hotfix/dist/controllers/initializer.js:33:23)
    at Object.throw (/home/dr4gon/Documents/chatbot3/node_modules/sulla-hotfix/dist/controllers/initializer.js:14:53)
    at rejected (/home/dr4gon/Documents/chatbot3/node_modules/sulla-hotfix/dist/controllers/initializer.js:6:65)
    at process._tickCallback (internal/process/next_tick.js:68:7)
(node:24800) 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: 2)
(node:24800) [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

Follow the code:

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!');
        }
    });
}
bug doesn't follow template

All 10 comments

Try ' npm i [email protected] ' to use an old version ...That work for me, not able to use new features but enable to work.

also to note all examples except the first in the readme are typescript! see readme how to install and run ts-node

Please add all the information from the template next time. I will fix it so it doesn't show this error log but there is something else wrong that is causing this.

@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);
  })();

Changelog

🚀 Release 1.8.16 (2020-03-11)

  • Release 1.8.16 94cfb9f
  • only kill browser if waPage is defined #204 0127868

Hi smashah, what happen if i already scan QR code, and end the execution of the ts-node. And after that i start again execution and hang in step "Loading QR". Do you know what is happening here? Someone else have the same issue?

image

Changelog

🚀 Release 1.8.16 (2020-03-11)

* Release 1.8.16 [`94cfb9f`](https://github.com/smashah/sulla/commit/94cfb9ffdd60a947fc94a68a11aac430165c89fd)

* only kill browser if waPage is defined #204 [`0127868`](https://github.com/smashah/sulla/commit/0127868519e0a9efd0b5677032f0b0488acde412)

Same error after upgrade form 1.7.35

If need more details of my procedures please letme know to fill the template, buy my server and procedures are the same as @scoorpionx

@lugoea @jesusvalverde Please use the latest versions and make sure you use a clean directory and follow the instructions.

IF you make another issue. Please follow the template and all possible information. There is no way I can help/fix without all the information.

@github-actions run


Template!

(async () => {
//label issue
await githubClient.issues. addLabels({
        issue_number: context.issue.number,
        owner: context.repo.owner,
        repo: context.repo.repo,
        labels: ["doesn't follow template"]
      })

 await postComment(`⚠️⚠️⚠️[Please follow this issue template](https://github.com/smashah/sulla/issues/new?assignees=&labels=&template=bug_report.md&title=)⚠️⚠️⚠️`);

//close issue
await githubClient.issues. update({
        issue_number: context.issue.number,
        owner: context.repo.owner,
        repo: context.repo.repo,
        state: "closed"
      })
})();

⚠️⚠️⚠️Please follow this issue template⚠️⚠️⚠️

Was this page helpful?
0 / 5 - 0 ratings

Related issues

pedrogrisolia picture pedrogrisolia  ·  4Comments

alishahlakhani picture alishahlakhani  ·  4Comments

vsilva472 picture vsilva472  ·  4Comments

arisros picture arisros  ·  4Comments

blackchineykh picture blackchineykh  ·  4Comments