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

TypeError: Cannot read properties of null (reading '1') #2885

Closed
1 task done
hussam-aldarwish opened this issue Apr 4, 2024 · 8 comments
Closed
1 task done

TypeError: Cannot read properties of null (reading '1') #2885

hussam-aldarwish opened this issue Apr 4, 2024 · 8 comments
Labels
bug Something isn't working

Comments

@hussam-aldarwish
Copy link

hussam-aldarwish commented Apr 4, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

I'm getting this TypeError when initializing the whatsapp client.

TypeError: Cannot read properties of null (reading '1')
    at LocalWebCache.persist (node_modules\whatsapp-web.js\src\webCache\LocalWebCache.js:34:69)
    at node_modules\whatsapp-web.js\src\Client.js:771:36
    at processTicksAndRejections (node:internal/process/task_queues:95:5)

Expected behavior

It worked when I tried to skip local caching by directly return like the follwing

    async persist(indexHtml) {
         return;
       }

But whithout local cache file stored in /.wwebjs_cache
As a temporary workaround

Steps to Reproduce the Bug or Issue

I already have another bot which was working properly, but whenever the client is restarted I faced this error.

Relevant Code

const version = indexHtml.match(/manifest-([\d\\.]+)\.json/)[1];

Browser Type

Google Chrome

WhatsApp Account Type

WhatsApp Business

Does your WhatsApp account have multidevice enabled?

Yes, I am using Multi Device

Environment

  • OS: tried on windows 10, ubuntu 22.04.4 LTS
  • whatsapp-web.js version 1.23.1-alpha.5
  • WhatsApp Web version: unable to run await client.getWWebVersion()
  • Node.js Version: tried on v20.11.1 and v16.20.2

Additional context

No response

@hussam-aldarwish hussam-aldarwish added the bug Something isn't working label Apr 4, 2024
@ichiopro
Copy link

ichiopro commented Apr 4, 2024

same with me. please help to fix it, thanks

@RudyBJ
Copy link

RudyBJ commented Apr 4, 2024

Estou com o mesmo problema, será que é devido a alguma atualização?

@OmarAttia
Copy link

same here

@codebugged
Copy link

@hussam-aldarwish Sir, can you please expedite this ?
We are facing challenges at client's end

@moradiyavipul
Copy link

TypeError: Cannot read properties of null (reading '1')
at LocalWebCache.persist (A:\whatsapp\node_modules\whatsapp-web.js\src\webCache\LocalWebCache.js:34:69)
at A:\whatsapp\node_modules\whatsapp-web.js\src\Client.js:759:36
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

@jdic
Copy link

jdic commented Apr 4, 2024

#2789

Just take the corresponding raw version from GitHub, here they are: https://github.com/wppconnect-team/wa-version/tree/main/html

when you already have it, (example: https://raw.githubusercontent.com/wppconnect-team/wa-version/main/html/2.2402.5-beta.html), in the launch arguments you should put it like this:

const client: Client = new Client({
  webVersionCache: 
  {
    remotePath: 'URL PATH HERE',
    type: 'remote' 
  } 
})

@gaurangDhameliya
Copy link

gaurangDhameliya commented Apr 4, 2024

#2789

Just take the corresponding raw version from GitHub, here they are: https://github.com/wppconnect-team/wa-version/tree/main/html

when you already have it, (example: https://raw.githubusercontent.com/wppconnect-team/wa-version/main/html/2.2402.5-beta.html), in the launch arguments you should put it like this:

const client: Client = new Client({
  webVersionCache: 
  {
    remotePath: 'URL PATH HERE',
    type: 'remote' 
  } 
})

Can you please tell me that which url i need to add in remotePath, And how can I get it?

@jdic
Copy link

jdic commented Apr 4, 2024

In this link are the wweb version lists, choose the one that corresponds with your version of whatsapp-web.js, you can try with 2.2402.5-beta.html, click on that file inside the given github repository list and click where it says raw, now copy the actual URL of the page and paste it in remoteAuth, it should work.

image

something like this:

const client = new Client({
  webVersionCache: 
  {
    remotePath: 'https://raw.githubusercontent.com/wppconnect-team/wa-version/main/html/2.2402.5-beta.html',
    type: 'remote' 
  } 
})

#2789
Just take the corresponding raw version from GitHub, here they are: https://github.com/wppconnect-team/wa-version/tree/main/html
when you already have it, (example: https://raw.githubusercontent.com/wppconnect-team/wa-version/main/html/2.2402.5-beta.html), in the launch arguments you should put it like this:

const client: Client = new Client({
  webVersionCache: 
  {
    remotePath: 'URL PATH HERE',
    type: 'remote' 
  } 
})

Can you please tell me that which url i need to add in remotePath, And how can I get it?

Repository owner locked and limited conversation to collaborators Apr 4, 2024
@alechkos alechkos closed this as not planned Won't fix, can't repro, duplicate, stale Apr 4, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

9 participants