Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: Evaluation failed: TypeError: Cannot read property 'default' of undefined #1117

Closed
contatodct opened this issue Nov 29, 2020 · 13 comments

Comments

@contatodct
Copy link

contatodct commented Nov 29, 2020

I am using Debian, 8.7 64Bits and the Open-wa Example, the first time it registers normally ..... it seems more that it loads a cache somewhere that when removing the Session and trying again to register another number it it happens...

TEMPLATE:

const wa = require('@open-wa/wa-automate');

wa.create({
  sessionId: "COVID_HELPER",
  authTimeout: 60, //wait only 60 seconds to get a connection with the host account device
  blockCrashLogs: true,
  disableSpins: true,
  headless: true,
  hostNotificationLang: 'PT_BR',
  logConsole: false,
  popup: true,
  qrTimeout: 0, //0 means it will wait forever for you to scan the qr code
}).then(client => start(client));

function start(client) {
  client.onMessage(async message => {
    if (message.body === 'Hi') {
      await client.sendText(message.from, '👋 Hello!');
    }
  });
}

100526843-8413f080-31ab-11eb-97f7-288c5518ce43

@smashah
Copy link
Member

smashah commented Nov 29, 2020

related: #1116

@smashah
Copy link
Member

smashah commented Nov 29, 2020

@contatodct when did this issue start and please add a screenshot of the browser here please

@contatodct
Copy link
Author

@smashah started about 5 days ago, I disabled the Browser with Use_chrome false

I am registering only through the terminal because I use Debian in text mode

@rahulserver
Copy link

I remember that this issue happened only after I tried registering from another number. Haven't tested this scenario on MAC though.

@contatodct
Copy link
Author

@rahulserver that's right, whatever, it happens on any operating system!

and it only happens when I try to register another number

@smashah
Copy link
Member

smashah commented Dec 2, 2020

@rahulserver @contatodct if this happens on every operating system can you kindly take a screen recording of the process or a screenshot of the browser window when this happens please. I'm unable to recreate the issue with the current information.

@contatodct
Copy link
Author

@smashah as I said, I don't use a browser, I use it directly on my DEBIAN 8.7 64Bits terminal

WhatsApp Video 2020-12-02 at 22.57.35.zip

@edneijunior
Copy link

edneijunior commented Dec 3, 2020

this happens with me too
what you think?
debug-js/debug#797

@smashah
Copy link
Member

smashah commented Dec 4, 2020

@contatodct I have a sneaking suspicion that you're getting tos-blocked and then the system forces it to untosblock itself (which wow cool). I just need confirmation of this with a screenshot of the web page. OR! A screenshot of the folder structure from your process working directory. When this happens next, please run ls and take a screenshot. There may be a lingering folder there which is acting as the 'cache' leading to this error. @rahulserver @edneijunior

So:

  1. Run the program
  2. If the error happens again, ctrl+c
  3. ls (it may also be in the directory of the code)
  4. Send me the screenshot here.

If that directory is there then simply deleting it before every run should fix this issue.

Another thing that may help is installing real chrome on your machines and running with useChrome: true.

Lastly, you really should NOT be running any puppeteer based program as root. Please make a new user and make that user run the program.

@Qix-
Copy link

Qix- commented Dec 4, 2020

@edneijunior This doesn't appear to have anything to do with debug. Please let me know if otherwise, but we have an upwards of 80 million weekly downloads with no reported issues thus far.

@smashah
Copy link
Member

smashah commented Dec 4, 2020

I also think this has nothing to do with debug

@smashah
Copy link
Member

smashah commented Dec 5, 2020

@rahulserver @contatodct I was not able to replicate the issue.

in https://github.com/open-wa/wa-automate-nodejs/releases/tag/3.1.4 it will take a screenshot if the error occurs again and add it into a logs folder. Please add this screenshot here next time.

This new version also tries to predict the error and attempts to "wait" for a valid session which may stop this problem from happening altogether.

I've spent the last few days trying to replicate this issue and will be spending some time on other issues. Please let me know if there are any updates. Closing for now. Thanks

@smashah smashah closed this as completed Dec 5, 2020
@smashah
Copy link
Member

smashah commented Dec 5, 2020

@rahulserver @contatodct this new version may have fixed the issue. It may have been a case of Debian being too fast for the code. Adding a 2 second cool off before continuing to get the QR code looks like it fixed it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants