Wednesday, April 3, 2024

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

When client logged and bot was restarted, i receive this error:


/app/node_modules/whatsapp-web.js/src/webCache/LocalWebCache.js:34
        const version = indexHtml.match(/manifest-([\d\\.]+)\.json/)[1];
                                                                    ^
TypeError: Cannot read properties of null (reading '1')
    at LocalWebCache.persist (/app/node_modules/whatsapp-web.js/src/webCache/LocalWebCache.js:34:69)
    at /app/node_modules/whatsapp-web.js/src/Client.js:771:36
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
Node.js v20.11.1

Solved problem: open file Constant.js, find and change


    webVersionCache: {
        type: 'local',
    },

to


    webVersionCache: {
        type: 'remote',
        remotePath: 'https://raw.githubusercontent.com/wppconnect-team/wa-version/main/html/2.2410.1.html',
    },
const version = indexHtml.match(/manifest-([\d\\.]+)\.json/)[1];

Post a Comment