whatsapp-web.js
whatsapp-web.js copied to clipboard
Error: Protocol error (Runtime.callFunctionOn): Target closed
Is there an existing issue for this?
- [X] I have searched the existing issues
Describe the bug
after restarting the client, I expect ->initialized ->ready, but I get an error. this happens quite often, the client is working properly and after some kind of global restart of the code (I use pm2 restart) it can stop at initialized
I tried adding '--shm-size=3gb' to the puppeteer arguments, but it didn't help and I had to delete the session folder and scan again
example of my client initialization
Expected behavior
I expect successful initialization, I get nothing, then if I restart one channel individually, I get the same error
Error: Protocol error (Runtime.callFunctionOn): Target closed
Steps to Reproduce the Bug or Issue
I cannot repeat it, I do not know the reason for its appearance
Relevant Code
No response
Browser Type
Other (please write in Additional Context)
WhatsApp Account Type
Standard
Does your WhatsApp account have multidevice enabled?
Yes, I am using Multi Device
Environment
"puppeteer": "^10.4.0", npm - 7.5.1, node - v15.8.0, "whatsapp-web.js": "^1.16.5"
Additional context
I do not know the browser version, I am connecting to puppeteer
sorry for the small amount of information and my English, I'm new to all this
I'm having the same problem when I call the client.destroy() function.
I'm having the same problem when I call the client.destroy() function.
Me too
Is there an existing issue for this?
- [x] I have searched the existing issues
Describe the bug
after restarting the client, I expect ->initialized ->ready, but I get an error. this happens quite often, the client is working properly and after some kind of global restart of the code (I use pm2 restart) it can stop at initialized
I tried adding '--shm-size=3gb' to the puppeteer arguments, but it didn't help and I had to delete the session folder and scan again
example of my client initialization
Expected behavior
I expect successful initialization, I get nothing, then if I restart one channel individually, I get the same error
Error: Protocol error (Runtime.callFunctionOn): Target closed
Steps to Reproduce the Bug or Issue
I cannot repeat it, I do not know the reason for its appearance
Relevant Code
No response
Browser Type
Other (please write in Additional Context)
WhatsApp Account Type
Standard
Does your WhatsApp account have multidevice enabled?
Yes, I am using Multi Device
Environment
"puppeteer": "^10.4.0", npm - 7.5.1, node - v15.8.0, "whatsapp-web.js": "^1.16.5"
Additional context
I do not know the browser version, I am connecting to puppeteer
sorry for the small amount of information and my English, I'm new to all this
me facing the same issues
me facing the same issues
I think it's chromium, when exiting it, it somehow breaks the sessions folder and saves only qr, but I don't understand when I exit it if I have a beta whatsapp and my client is always active
I'm having the same problem. Any ideias how to workaround or a fix?
Has anyone found a solution for this? For me it happens when I send an audio
@pedroslopez can you think of an ideal solution here? what if we catch everything, then, if it matches this error here then we ignore otherwise we throw?
Same issues. Has anyone found a solution for this?
Same here.
I'm using NestJS
and whenever I refresh the server (with watch-mode on. i.e npm run start:dev
) I get this error ( (Runtime.callFunctionOn): Target closed
)
Plus NestJS throws a listen EADDRINUSE: address already in use :::8080
. (8080 is an example, bcos any port results with this error)
It seems like whatsapp-web.js takes NestJS's port, and then on refresh the NestJS' port is already in use.
I can't figure it out, I'd appreciate any help with both errors.
(I tried changing NestJS's port - it still throws a already in use
error)
Same issue here (when using client.destroy(). Has anyone found a solution?
same here, need a workaround. anyone ?
I was facing this too, when I use headless: false. Then I removed the single-process argument and it worked fine.
now I faced this with headless: true + single-process. Disabling single-process now to see how it goes...
This error is caused because of the destroy function
adding a catch to .initialize() like this would be a workaround for now
client.initialize().catch(_ => _)
I am using the catch since several months and still having the issue :(
The browser randomly closes and the session gets lost...
Same issue here, someone found a solution?
Sure thing, but I would love to see a proper update on this if possible.
Same issue here
Same issue here
I am having the same issue. @pedroslopez do you have any thoughts on this error?