TypeError: Cannot read properties of null (reading '1')
at LocalWebCache.persist (C:\Job\wabot7\node_modules\whatsapp-web.js\src\webCache\LocalWebCache.js:34:69)
at C:\Job\wabot7\node_modules\whatsapp-web.js\src\Client.js:733:36
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
Expected behavior
нужен запуск ватсап, не вижу решений, во всех ветках нет алгоритма решения, списка нужных команд
Steps to Reproduce the Bug or Issue
after start bot:
Then I do:
npm r (deinstall)
Then I tried to solve the problem with tips, but the error remained:
Please Help! Admin dont closed please, in #2789 - didn't find a solution!
LocalWebCache - Fetches a WhatsApp Web version from a local file store
@param {object} options - options
@param {string} options.path - Path to the directory where cached versions are saved, default is: "./.wwebjs_cache/"
@param {boolean} options.strict - If true, will throw an error if the requested version can't be fetched. If false, will resolve to the latest version.
*/
class LocalWebCache extends WebCache {
constructor(options = {}) {
super();
try {
return fs.readFileSync(filePath, "utf-8");
} catch (err) {
if (this.strict)
throw new VersionResolveError(
`Couldn't load version ${version} from the cache`,
);
return null;
}
}
async persist(indexHtml) {
// extract version from index (e.g. manifest-2.2206.9.json -> 2.2206.9)
const version = indexHtml.match(/manifest-([\d\.]+).json/)?.[1];
if (!version) return;
Is there an existing issue for this?
Describe the bug
TypeError: Cannot read properties of null (reading '1') at LocalWebCache.persist (C:\Job\wabot7\node_modules\whatsapp-web.js\src\webCache\LocalWebCache.js:34:69) at C:\Job\wabot7\node_modules\whatsapp-web.js\src\Client.js:733:36 at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
Expected behavior
нужен запуск ватсап, не вижу решений, во всех ветках нет алгоритма решения, списка нужных команд
Steps to Reproduce the Bug or Issue
after start bot:![error](https://github.com/pedroslopez/whatsapp-web.js/assets/143048829/44f6b2c0-c42b-4edb-a590-af7b083b92ec)
Then I do: npm r (deinstall)
Then I tried to solve the problem with tips, but the error remained:![error1](https://github.com/pedroslopez/whatsapp-web.js/assets/143048829/fb2e50d2-7b5d-4eb7-80ee-4a66d6ae89b5)
Please Help! Admin dont closed please, in #2789 - didn't find a solution!
Relevant Code
File - C:\Job\wabot7\src\webCache\LocalWebCache.js :
const path = require("path"); const fs = require("fs");
const { WebCache, VersionResolveError } = require("./WebCache");
/**
@param {boolean} options.strict - If true, will throw an error if the requested version can't be fetched. If false, will resolve to the latest version. */ class LocalWebCache extends WebCache { constructor(options = {}) { super();
}
async resolve(version) { const filePath = path.join(this.path,
${version}.html
);}
async persist(indexHtml) { // extract version from index (e.g. manifest-2.2206.9.json -> 2.2206.9) const version = indexHtml.match(/manifest-([\d\.]+).json/)?.[1]; if (!version) return;
} }
module.exports = LocalWebCache;
Browser Type
Chromium
WhatsApp Account Type
WhatsApp Business
Does your WhatsApp account have multidevice enabled?
No, I am not using Multi Device
Environment
Windows
Additional context
didn't find the right advice