Closed ahmed-safari closed 3 years ago
Quick update: I found a workaround for this issue. I run the phone number through the checkNumberStatus()
method and then I get the phone number from the response of that method. I then use the new number ( without the zero ) and send the text message.
@Sp0derDev 974055xxxxxx
isn't really a valid number but the library should respond with Error: Number not linked to WhatsApp Account
Error when sending: Error: Evaluation failed: TypeError: Cannot read property 'sendMessage' of undefined
at eval (eval at <anonymous> (:1:27), <anonymous>:1:34774)
at X (https://web.whatsapp.com/bootstrap_qr.8c6bd07fd55e4b8fbdb7.js:1:307039)
at MutationObserver.H (https://web.whatsapp.com/bootstrap_qr.8c6bd07fd55e4b8fbdb7.js:1:306620)
at ExecutionContext._evaluateInternal (/home/nodejs/nodeApps/API/node_modules/puppeteer/lib/cjs/puppeteer/common/ExecutionContext.js:217:19)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
at async ExecutionContext.evaluate (/home/nodejs/nodeApps/API/node_modules/puppeteer/lib/cjs/puppeteer/common/ExecutionContext.js:106:16)
This is the error I get. Also, as I mentioned above. When I use the checkNumberStatus()
it works and returns the number without the extra zero,
thanks for the error logs. seems to be related to #1495
If you could maybe implement the workaround I mentioned instead of throwing an error. That would be great!
@Sp0derDev please update to v3.9.7 and try again. If it continues then continue the discussion in #1495 as it seems like this is a duplicate issue.
Describe the bug I get a "generic?" error when someone adds a zero before their numbers and after the country code. For example Success if number is +97455xxxxxx Fail with the above error if number is +974055xxxxxx ( same number but with an added zero after the country code )
Steps to Reproduce Steps to reproduce the behavior:
create() code This is the code you use to create the client. e.g
Expected behavior To either remove the zero and work correctly or to throw a specific error.
DEBUG INFO This is the info printed to the console when you start your app. It should look like this
Screenshots If applicable, add screenshots to help explain your problem. Use
headless: false
to get screenshotsHost (please complete the following information):
Additional context Add any other context about the problem here.