Closed Eonus closed 1 month ago
same here
unhandledRejection signal received.
TypeError: Cannot read properties of null (reading '1')
TypeError: Cannot read properties of null (reading '1')
at LocalWebCache.persist (C:\iconatus\scripts-iconatus\bot-whatsapp-ai-send\node_modules\whatsapp-web.js\src\webCache\LocalWebCache.js:34:69)
at C:\iconatus\scripts-iconatus\bot-whatsapp-ai-send\node_modules\whatsapp-web.js\src\Client.js:744:36
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
same here
unhandledRejection signal received. TypeError: Cannot read properties of null (reading '1') TypeError: Cannot read properties of null (reading '1') at LocalWebCache.persist (C:\iconatus\scripts-iconatus\bot-whatsapp-ai-send\node_modules\whatsapp-web.js\src\webCache\LocalWebCache.js:34:69) at C:\iconatus\scripts-iconatus\bot-whatsapp-ai-send\node_modules\whatsapp-web.js\src\Client.js:744:36 at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
the solution is here , it works for me
const wwebVersion = '2.2407.3';
const client = new Client({
authStrategy: new LocalAuth(), // your authstrategy here
puppeteer: {
// puppeteer args here
},
webVersionCache: {
type: 'remote',
remotePath: `https://raw.githubusercontent.com/wppconnect-team/wa-version/main/html/${wwebVersion}.html`,
},
});
same here
unhandledRejection signal received. TypeError: Cannot read properties of null (reading '1') TypeError: Cannot read properties of null (reading '1') at LocalWebCache.persist (C:\iconatus\scripts-iconatus\bot-whatsapp-ai-send\node_modules\whatsapp-web.js\src\webCache\LocalWebCache.js:34:69) at C:\iconatus\scripts-iconatus\bot-whatsapp-ai-send\node_modules\whatsapp-web.js\src\Client.js:744:36 at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
the solution is here , it works for me
const wwebVersion = '2.2407.3'; const client = new Client({ authStrategy: new LocalAuth(), // your authstrategy here puppeteer: { // puppeteer args here }, webVersionCache: { type: 'remote', remotePath: `https://raw.githubusercontent.com/wppconnect-team/wa-version/main/html/${wwebVersion}.html`, }, });
even when you restart?
const client = new Client({
I see, but in our case, we are using RemoteAuth
, and this would hardcode the same version (2.2407.3
) for every client that creates a whatsapp session, am I correct?
EDIT: fix typo
same here
unhandledRejection signal received. TypeError: Cannot read properties of null (reading '1') TypeError: Cannot read properties of null (reading '1') at LocalWebCache.persist (C:\iconatus\scripts-iconatus\bot-whatsapp-ai-send\node_modules\whatsapp-web.js\src\webCache\LocalWebCache.js:34:69) at C:\iconatus\scripts-iconatus\bot-whatsapp-ai-send\node_modules\whatsapp-web.js\src\Client.js:744:36 at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
the solution is here , it works for me
const wwebVersion = '2.2407.3'; const client = new Client({ authStrategy: new LocalAuth(), // your authstrategy here puppeteer: { // puppeteer args here }, webVersionCache: { type: 'remote', remotePath: `https://raw.githubusercontent.com/wppconnect-team/wa-version/main/html/${wwebVersion}.html`, }, });
even when you restart?
Yes, it works for me after restart
same here
unhandledRejection signal received. TypeError: Cannot read properties of null (reading '1') TypeError: Cannot read properties of null (reading '1') at LocalWebCache.persist (C:\iconatus\scripts-iconatus\bot-whatsapp-ai-send\node_modules\whatsapp-web.js\src\webCache\LocalWebCache.js:34:69) at C:\iconatus\scripts-iconatus\bot-whatsapp-ai-send\node_modules\whatsapp-web.js\src\Client.js:744:36 at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
the solution is here , it works for me
const wwebVersion = '2.2407.3'; const client = new Client({ authStrategy: new LocalAuth(), // your authstrategy here puppeteer: { // puppeteer args here }, webVersionCache: { type: 'remote', remotePath: `https://raw.githubusercontent.com/wppconnect-team/wa-version/main/html/${wwebVersion}.html`, }, });
even when you restart?
Where did you put this code? In Client.js file?
Yes, it works, but what can we do when this wwebVersion of wppconnect get outdated?
same here
unhandledRejection signal received. TypeError: Cannot read properties of null (reading '1') TypeError: Cannot read properties of null (reading '1') at LocalWebCache.persist (C:\iconatus\scripts-iconatus\bot-whatsapp-ai-send\node_modules\whatsapp-web.js\src\webCache\LocalWebCache.js:34:69) at C:\iconatus\scripts-iconatus\bot-whatsapp-ai-send\node_modules\whatsapp-web.js\src\Client.js:744:36 at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
the solution is here , it works for me
const wwebVersion = '2.2407.3'; const client = new Client({ authStrategy: new LocalAuth(), // your authstrategy here puppeteer: { // puppeteer args here }, webVersionCache: { type: 'remote', remotePath: `https://raw.githubusercontent.com/wppconnect-team/wa-version/main/html/${wwebVersion}.html`, }, });
even when you restart?
Where did you put this code? In Client.js file?
I put that code in my main js file , where i create the conexion to whatsappweb.js
@maurotlxd, would you happen to know what can I do when using RemoteAuth
? This works for one session
same here
unhandledRejection signal received. TypeError: Cannot read properties of null (reading '1') TypeError: Cannot read properties of null (reading '1') at LocalWebCache.persist (C:\iconatus\scripts-iconatus\bot-whatsapp-ai-send\node_modules\whatsapp-web.js\src\webCache\LocalWebCache.js:34:69) at C:\iconatus\scripts-iconatus\bot-whatsapp-ai-send\node_modules\whatsapp-web.js\src\Client.js:744:36 at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
the solution is here , it works for me
const wwebVersion = '2.2407.3'; const client = new Client({ authStrategy: new LocalAuth(), // your authstrategy here puppeteer: { // puppeteer args here }, webVersionCache: { type: 'remote', remotePath: `https://raw.githubusercontent.com/wppconnect-team/wa-version/main/html/${wwebVersion}.html`, }, });
even when you restart?
Where did you put this code? In Client.js file?
I put that code in my main js file , where i create the conexion to whatsappweb.js
For those unfamiliar with the source of LocalAuth
, it can be imported from whatsapp-web-js
const { Client, LocalAuth } = require("whatsapp-web.js");
También el mismo problema.
También el mismo problema.
A mi me funciono las soluciones de
const wwebVersion = '2.2407.3';
const client = new Client({
authStrategy: new LocalAuth(), // your authstrategy here
puppeteer: {
// puppeteer args here
},
webVersionCache: {
type: 'remote',
remotePath: `https://raw.githubusercontent.com/wppconnect-team/wa-version/main/html/${wwebVersion}.html`,
},
});
Lo unico es que tuve que borrar las sessiones ya existentes y hacer login con QR desde el principio
the project moduleRaid was updated, however still necessary to update file src/util/Intected.js
const isComet = parseInt(window.Debug?.VERSION?.split(".")?.[1]) >= 3000;
console.warn('COMET package version:%s', window.Debug?.VERSION)
eval('var moduleRaid = ' + moduleRaidStr);
// eslint-disable-next-line no-undef
window.mR = moduleRaid();
//window.Store = Object.assign({}, window.mR.findModule(m => m.default && m.default.Chat)[0].default);
window.Store = {};
if (isComet) {
window.Store.Chat = window.mR.findModule('Chat')[1].Chat;
} else {
window.Store.Chat = window.mR.findModule(m => m.default && m.default.Chat)[0].default.Chat;
}
window.Store.AppState = window.mR.findModule('Socket')[0].Socket;
window.Store.Conn = window.mR.findModule('Conn')[0].Conn;
window.Store.BlockContact = window.mR.findModule('blockContact')[0];
if (isComet) {
window.Store.Call = window.mR.findModule('Call')[0].Call;
} else {
window.Store.Call = window.mR.findModule((module) => module.default && module.default.Call)[0].default.Call;
}
window.Store.Cmd = window.mR.findModule('Cmd')[0].Cmd;
window.Store.CryptoLib = window.mR.findModule('decryptE2EMedia')[0];
window.Store.DownloadManager = window.mR.findModule('downloadManager')[0].downloadManager;
if (isComet) {
window.Store.GroupMetadata = window.mR.findModule('GroupMetadata')[0].GroupMetadata;
} else {
window.Store.GroupMetadata = window.mR.findModule('GroupMetadata')[0].default.GroupMetadata;
}
if (isComet) {
window.Store.GroupMetadata.queryAndUpdate = window.mR.findModule('queryAndUpdateGroupMetadataById')[0].queryAndUpdateGroupMetadataById;
} else {
window.Store.GroupMetadata.queryAndUpdate = window.mR.findModule('queryAndUpdateGroupMetadataById')[0].queryAndUpdateGroupMetadataById;
}
if (isComet) {
window.Store.Contact = window.mR.findModule('Contact')[0].Contact;
}
window.Store.Label = window.mR.findModule('LabelCollection')[0].LabelCollection;
window.Store.ContactCollection = window.mR.findModule('ContactCollection')[0].ContactCollection;
window.Store.MediaPrep = window.mR.findModule('prepRawMedia')[0];
window.Store.MediaObject = window.mR.findModule('getOrCreateMediaObject')[0];
window.Store.NumberInfo = window.mR.findModule('formattedPhoneNumber')[0];
window.Store.MediaTypes = window.mR.findModule('msgToMediaType')[0];
window.Store.MediaUpload = window.mR.findModule('uploadMedia')[0];
if (isComet) {
window.Store.MsgKey = window.mR.findModule('fromString')[0];
} else {
window.Store.MsgKey = window.mR.findModule((module) => module.default && module.default.fromString)[0].default;
}
if (isComet) {
window.Store.Msg = window.mR.findModule('Msg')[1].Msg;
}
if (isComet) {
window.Store.OpaqueData = window.mR.findModule('createFromData')[0];
} else {
window.Store.OpaqueData = window.mR.findModule(module => module.default && module.default.createFromData)[0].default;
}
window.Store.QueryProduct = window.mR.findModule('queryProduct')[0];
window.Store.QueryOrder = window.mR.findModule('queryOrder')[0];
window.Store.SendClear = window.mR.findModule('sendClear')[0];
window.Store.SendDelete = window.mR.findModule('sendDelete')[0];
window.Store.SendMessage = window.mR.findModule('addAndSendMsgToChat')[0];
window.Store.EditMessage = window.mR.findModule('addAndSendMessageEdit')[0];
window.Store.SendSeen = window.mR.findModule('sendSeen')[0];
window.Store.User = window.mR.findModule('getMaybeMeUser')[0];
window.Store.ContactMethods = window.mR.findModule('getUserid')[0];
window.Store.BusinessProfileCollection = window.mR.findModule('BusinessProfileCollection')[0].BusinessProfileCollection;
if (isComet) {
window.Store.UploadUtils = window.mR.findModule('encryptAndUpload')[0].encryptAndUpload;
} else {
window.Store.UploadUtils = window.mR.findModule((module) => (module.default && module.default.encryptAndUpload) ? module.default : null)[0].default;
}
if (isComet) {
try {
window.Store.UserConstructor = window.mR.findModule((module) => (module.default && module.default.prototype && module.default.prototype.isServer && module.default.prototype.isUser) ? module.default : null)[0].default;
} catch (e) {
try {
window.Store.UserConstructor = window.mR.findModule('isServer')[0].isServer;
} catch (e2) {
try {
window.Store.UserConstructor = window.mR.findModule('isUser')[0].isUser;
} catch (e3) {
let checkType = window.mR.findModule((module) => (module.default && module.default.prototype && module.default.prototype.isServer && module.default.prototype.isUser))[0].default
if (checkType.isServer) {
window.Store.UserConstructor = checkType.isServer
} else if (checkType.isUser) {
window.Store.UserConstructor = checkType.isUser
}
}
}
}
} else {
window.Store.UserConstructor = window.mR.findModule((module) => (module.default && module.default.prototype && module.default.prototype.isServer && module.default.prototype.isUser) ? module.default : null)[0].default;
}
window.Store.Validators = window.mR.findModule('findLinks')[0];
the project moduleRaid was updated, however still necessary to update file src/util/Intected.js
const isComet = parseInt(window.Debug?.VERSION?.split(".")?.[1]) >= 3000; console.warn('COMET package version:%s', window.Debug?.VERSION) eval('var moduleRaid = ' + moduleRaidStr); // eslint-disable-next-line no-undef window.mR = moduleRaid(); //window.Store = Object.assign({}, window.mR.findModule(m => m.default && m.default.Chat)[0].default); window.Store = {}; if (isComet) { window.Store.Chat = window.mR.findModule('Chat')[1].Chat; } else { window.Store.Chat = window.mR.findModule(m => m.default && m.default.Chat)[0].default.Chat; } window.Store.AppState = window.mR.findModule('Socket')[0].Socket; window.Store.Conn = window.mR.findModule('Conn')[0].Conn; window.Store.BlockContact = window.mR.findModule('blockContact')[0]; if (isComet) { window.Store.Call = window.mR.findModule('Call')[0].Call; } else { window.Store.Call = window.mR.findModule((module) => module.default && module.default.Call)[0].default.Call; } window.Store.Cmd = window.mR.findModule('Cmd')[0].Cmd; window.Store.CryptoLib = window.mR.findModule('decryptE2EMedia')[0]; window.Store.DownloadManager = window.mR.findModule('downloadManager')[0].downloadManager; if (isComet) { window.Store.GroupMetadata = window.mR.findModule('GroupMetadata')[0].GroupMetadata; } else { window.Store.GroupMetadata = window.mR.findModule('GroupMetadata')[0].default.GroupMetadata; } if (isComet) { window.Store.GroupMetadata.queryAndUpdate = window.mR.findModule('queryAndUpdateGroupMetadataById')[0].queryAndUpdateGroupMetadataById; } else { window.Store.GroupMetadata.queryAndUpdate = window.mR.findModule('queryAndUpdateGroupMetadataById')[0].queryAndUpdateGroupMetadataById; } if (isComet) { window.Store.Contact = window.mR.findModule('Contact')[0].Contact; } window.Store.Label = window.mR.findModule('LabelCollection')[0].LabelCollection; window.Store.ContactCollection = window.mR.findModule('ContactCollection')[0].ContactCollection; window.Store.MediaPrep = window.mR.findModule('prepRawMedia')[0]; window.Store.MediaObject = window.mR.findModule('getOrCreateMediaObject')[0]; window.Store.NumberInfo = window.mR.findModule('formattedPhoneNumber')[0]; window.Store.MediaTypes = window.mR.findModule('msgToMediaType')[0]; window.Store.MediaUpload = window.mR.findModule('uploadMedia')[0]; if (isComet) { window.Store.MsgKey = window.mR.findModule('fromString')[0]; } else { window.Store.MsgKey = window.mR.findModule((module) => module.default && module.default.fromString)[0].default; } if (isComet) { window.Store.Msg = window.mR.findModule('Msg')[1].Msg; } if (isComet) { window.Store.OpaqueData = window.mR.findModule('createFromData')[0]; } else { window.Store.OpaqueData = window.mR.findModule(module => module.default && module.default.createFromData)[0].default; } window.Store.QueryProduct = window.mR.findModule('queryProduct')[0]; window.Store.QueryOrder = window.mR.findModule('queryOrder')[0]; window.Store.SendClear = window.mR.findModule('sendClear')[0]; window.Store.SendDelete = window.mR.findModule('sendDelete')[0]; window.Store.SendMessage = window.mR.findModule('addAndSendMsgToChat')[0]; window.Store.EditMessage = window.mR.findModule('addAndSendMessageEdit')[0]; window.Store.SendSeen = window.mR.findModule('sendSeen')[0]; window.Store.User = window.mR.findModule('getMaybeMeUser')[0]; window.Store.ContactMethods = window.mR.findModule('getUserid')[0]; window.Store.BusinessProfileCollection = window.mR.findModule('BusinessProfileCollection')[0].BusinessProfileCollection; if (isComet) { window.Store.UploadUtils = window.mR.findModule('encryptAndUpload')[0].encryptAndUpload; } else { window.Store.UploadUtils = window.mR.findModule((module) => (module.default && module.default.encryptAndUpload) ? module.default : null)[0].default; } if (isComet) { try { window.Store.UserConstructor = window.mR.findModule((module) => (module.default && module.default.prototype && module.default.prototype.isServer && module.default.prototype.isUser) ? module.default : null)[0].default; } catch (e) { try { window.Store.UserConstructor = window.mR.findModule('isServer')[0].isServer; } catch (e2) { try { window.Store.UserConstructor = window.mR.findModule('isUser')[0].isUser; } catch (e3) { let checkType = window.mR.findModule((module) => (module.default && module.default.prototype && module.default.prototype.isServer && module.default.prototype.isUser))[0].default if (checkType.isServer) { window.Store.UserConstructor = checkType.isServer } else if (checkType.isUser) { window.Store.UserConstructor = checkType.isUser } } } } } else { window.Store.UserConstructor = window.mR.findModule((module) => (module.default && module.default.prototype && module.default.prototype.isServer && module.default.prototype.isUser) ? module.default : null)[0].default; } window.Store.Validators = window.mR.findModule('findLinks')[0];
Can you explain a little more? Using this file version we can use on 2.3x?
También el mismo problema.
A mi me funciono las soluciones de
const wwebVersion = '2.2407.3'; const client = new Client({ authStrategy: new LocalAuth(), // your authstrategy here puppeteer: { // puppeteer args here }, webVersionCache: { type: 'remote', remotePath: `https://raw.githubusercontent.com/wppconnect-team/wa-version/main/html/${wwebVersion}.html`, }, });
Lo unico es que tuve que borrar las sessiones ya existentes y hacer login con QR desde el principio
Lo mismo,a mi también me funcionó esto,solo borre las sesiones
webpack-exodus branch Just release a fix
If anyone encounter error while trying to send media using new release
Just change this line
const mediaObject = window.Store.MediaObject.getOrCreateMediaObject(mediaData.filehash);
Into this
const mediaObject = window.Store.MediaObject(mediaData.filehash);
In src/util/Utils.js on line 323, and give a try
Another approach and to keep legacy compatibility, is to change the line which export mediaobject in
src/util/Injected/store.js
from
window.Store.MediaObject = require('WAWebMediaStorage').getOrCreateMediaObject;
To
window.Store.MediaObject = require('WAWebMediaStorage');
In this way we do not need to change the Utils.js file because is common between legacy and version, and we just change store exposing for new one where the real issue occurs
If anyone encounter error while trying to send media using new release
Just change this line
const mediaObject = window.Store.MediaObject.getOrCreateMediaObject(mediaData.filehash);
Into this
const mediaObject = window.Store.MediaObject(mediaData.filehash);
In src/util/Utils.js on line 323, and give a try
wouldn't it be in Injected.js file?
If anyone encounter error while trying to send media using new release Just change this line
const mediaObject = window.Store.MediaObject.getOrCreateMediaObject(mediaData.filehash);
Into thisconst mediaObject = window.Store.MediaObject(mediaData.filehash);
In src/util/Utils.js on line 323, and give a trywouldn't it be in Injected.js file?
In new release there is no injected.js but instead there is store.js, check src/util folder
If anyone encounter error while trying to send media using new release Just change this line
const mediaObject = window.Store.MediaObject.getOrCreateMediaObject(mediaData.filehash);
Into thisconst mediaObject = window.Store.MediaObject(mediaData.filehash);
In src/util/Utils.js on line 323, and give a trywouldn't it be in Injected.js file?
In new release there is no injected.js but instead there is store.js, check src/util folder
I found it, but in Injected subpath, It's working, thx
This worked for me
let modObj = {};
if (parseFloat(window.Debug.VERSION) < 2.3) {
(window.webpackChunkbuild || window.webpackChunkwhatsapp_web_client).push([["parasiteijn34h82hdf"], {},
function (findMod) {
// Percorrendo os módulos encontrados e adicionando-os ao objeto modObj
Object.keys(findMod.m).forEach(function (mod) { modObj[mod] = findMod(mod); })
}]);
} else {
let modules = self.require('__debug').modulesMap;
Object.keys(modules).filter(e => e.includes("WA")).forEach(function (mod) {
let modulos = modules[mod];
if (modulos) {
modObj[mod] = {
default: modulos.defaultExport,
factory: modulos.factory,
...modulos
};
if (Object.keys(modObj[mod].default).length == 0) {
try {
self.ErrorGuard.skipGuardGlobal(true);
Object.assign(modObj[mod], self.importNamespace(mod));
} catch (e) {
}
}
}
})
}
register(modObj);
This worked for me
let modObj = {}; if (parseFloat(window.Debug.VERSION) < 2.3) { (window.webpackChunkbuild || window.webpackChunkwhatsapp_web_client).push([["parasiteijn34h82hdf"], {}, function (findMod) { // Percorrendo os módulos encontrados e adicionando-os ao objeto modObj Object.keys(findMod.m).forEach(function (mod) { modObj[mod] = findMod(mod); }) }]); } else { let modules = self.require('__debug').modulesMap; Object.keys(modules).filter(e => e.includes("WA")).forEach(function (mod) { let modulos = modules[mod]; if (modulos) { modObj[mod] = { default: modulos.defaultExport, factory: modulos.factory, ...modulos }; if (Object.keys(modObj[mod].default).length == 0) { try { self.ErrorGuard.skipGuardGlobal(true); Object.assign(modObj[mod], self.importNamespace(mod)); } catch (e) { } } } }) } register(modObj);
where to modify this code?
webpack-exodus branch Just release a fix
this work for me!
webpack-exodus branch Just release a fix
this work for me!
how do we do this
webpack-exodus branch Just release a fix
this work for me!
how do we do this
Depends on where you use it, I would just replace the implementation of window.Store
I got related error Cannot read properties of null (reading '1'), setting webVersionCache helped me too
Hi, Which file I need to modify to get it working?
Anyone know how to use the new PR update ?
Hello everyone ı found solve...
Works it mee . please try
File location : node_modules/@pedroslopez/moduleraid bla bla , only one file have...
Then only " fillModuleArray function area change..
This is code ;
fillModuleArray = function() {
if (parseFloat(window.Debug.VERSION) < 2.3) {
(window.webpackChunkbuild || window.webpackChunkwhatsapp_web_client).push([
[moduleRaid.mID], {}, function(e) {
Object.keys(e.m).forEach(function(mod) {
moduleRaid.mObj[mod] = e(mod);
})
}
]);
} else {
let modules = self.require('__debug').modulesMap;
Object.keys(modules).filter(e => e.includes("WA")).forEach(function (mod) {
let modulos = modules[mod];
if (modulos) {
moduleRaid.mObj[mod] = {
default: modulos.defaultExport,
factory: modulos.factory,
...modulos
};
if (Object.keys(moduleRaid.mObj[mod].default).length == 0) {
try {
self.ErrorGuard.skipGuardGlobal(true);
Object.assign(moduleRaid.mObj[mod], self.importNamespace(mod));
} catch (e) {
}
}
}
})
}
}
fillModuleArray();
the project moduleRaid was updated, however still necessary to update file src/util/Intected.js
const isComet = parseInt(window.Debug?.VERSION?.split(".")?.[1]) >= 3000; console.warn('COMET package version:%s', window.Debug?.VERSION) eval('var moduleRaid = ' + moduleRaidStr); // eslint-disable-next-line no-undef window.mR = moduleRaid(); //window.Store = Object.assign({}, window.mR.findModule(m => m.default && m.default.Chat)[0].default); window.Store = {}; if (isComet) { window.Store.Chat = window.mR.findModule('Chat')[1].Chat; } else { window.Store.Chat = window.mR.findModule(m => m.default && m.default.Chat)[0].default.Chat; } window.Store.AppState = window.mR.findModule('Socket')[0].Socket; window.Store.Conn = window.mR.findModule('Conn')[0].Conn; window.Store.BlockContact = window.mR.findModule('blockContact')[0]; if (isComet) { window.Store.Call = window.mR.findModule('Call')[0].Call; } else { window.Store.Call = window.mR.findModule((module) => module.default && module.default.Call)[0].default.Call; } window.Store.Cmd = window.mR.findModule('Cmd')[0].Cmd; window.Store.CryptoLib = window.mR.findModule('decryptE2EMedia')[0]; window.Store.DownloadManager = window.mR.findModule('downloadManager')[0].downloadManager; if (isComet) { window.Store.GroupMetadata = window.mR.findModule('GroupMetadata')[0].GroupMetadata; } else { window.Store.GroupMetadata = window.mR.findModule('GroupMetadata')[0].default.GroupMetadata; } if (isComet) { window.Store.GroupMetadata.queryAndUpdate = window.mR.findModule('queryAndUpdateGroupMetadataById')[0].queryAndUpdateGroupMetadataById; } else { window.Store.GroupMetadata.queryAndUpdate = window.mR.findModule('queryAndUpdateGroupMetadataById')[0].queryAndUpdateGroupMetadataById; } if (isComet) { window.Store.Contact = window.mR.findModule('Contact')[0].Contact; } window.Store.Label = window.mR.findModule('LabelCollection')[0].LabelCollection; window.Store.ContactCollection = window.mR.findModule('ContactCollection')[0].ContactCollection; window.Store.MediaPrep = window.mR.findModule('prepRawMedia')[0]; window.Store.MediaObject = window.mR.findModule('getOrCreateMediaObject')[0]; window.Store.NumberInfo = window.mR.findModule('formattedPhoneNumber')[0]; window.Store.MediaTypes = window.mR.findModule('msgToMediaType')[0]; window.Store.MediaUpload = window.mR.findModule('uploadMedia')[0]; if (isComet) { window.Store.MsgKey = window.mR.findModule('fromString')[0]; } else { window.Store.MsgKey = window.mR.findModule((module) => module.default && module.default.fromString)[0].default; } if (isComet) { window.Store.Msg = window.mR.findModule('Msg')[1].Msg; } if (isComet) { window.Store.OpaqueData = window.mR.findModule('createFromData')[0]; } else { window.Store.OpaqueData = window.mR.findModule(module => module.default && module.default.createFromData)[0].default; } window.Store.QueryProduct = window.mR.findModule('queryProduct')[0]; window.Store.QueryOrder = window.mR.findModule('queryOrder')[0]; window.Store.SendClear = window.mR.findModule('sendClear')[0]; window.Store.SendDelete = window.mR.findModule('sendDelete')[0]; window.Store.SendMessage = window.mR.findModule('addAndSendMsgToChat')[0]; window.Store.EditMessage = window.mR.findModule('addAndSendMessageEdit')[0]; window.Store.SendSeen = window.mR.findModule('sendSeen')[0]; window.Store.User = window.mR.findModule('getMaybeMeUser')[0]; window.Store.ContactMethods = window.mR.findModule('getUserid')[0]; window.Store.BusinessProfileCollection = window.mR.findModule('BusinessProfileCollection')[0].BusinessProfileCollection; if (isComet) { window.Store.UploadUtils = window.mR.findModule('encryptAndUpload')[0].encryptAndUpload; } else { window.Store.UploadUtils = window.mR.findModule((module) => (module.default && module.default.encryptAndUpload) ? module.default : null)[0].default; } if (isComet) { try { window.Store.UserConstructor = window.mR.findModule((module) => (module.default && module.default.prototype && module.default.prototype.isServer && module.default.prototype.isUser) ? module.default : null)[0].default; } catch (e) { try { window.Store.UserConstructor = window.mR.findModule('isServer')[0].isServer; } catch (e2) { try { window.Store.UserConstructor = window.mR.findModule('isUser')[0].isUser; } catch (e3) { let checkType = window.mR.findModule((module) => (module.default && module.default.prototype && module.default.prototype.isServer && module.default.prototype.isUser))[0].default if (checkType.isServer) { window.Store.UserConstructor = checkType.isServer } else if (checkType.isUser) { window.Store.UserConstructor = checkType.isUser } } } } } else { window.Store.UserConstructor = window.mR.findModule((module) => (module.default && module.default.prototype && module.default.prototype.isServer && module.default.prototype.isUser) ? module.default : null)[0].default; } window.Store.Validators = window.mR.findModule('findLinks')[0];
Uncaught ReferenceError: moduleRaidStr is not defined
Funcionou pra mim fazendo: Alterando em: webCache/LocalWebCache.js a linha 34; De: const version = indexHtml.match(/manifest-([\d\.]+).json/)[1]; Para: const version = indexHtml.match(/manifest.json/)[1]; Depois fui em moduleRaid na lib node_modules/@pedroslopez/moduleraid e fiz a modificação do Devaec
Funcionou pra mim fazendo: Alterando em: webCache/LocalWebCache.js a linha 34; De: const version = indexHtml.match(/manifest-([\d.]+).json/)[1]; Para: const version = indexHtml.match(/manifest.json/)[1]; Depois fui em moduleRaid na lib node_modules/@pedroslopez/moduleraid e fiz a modificação do Devaec
Testei a sua solução e a conexão é feita, mas outros erros começaram a aparecer.
Quando envio a mensagem para o Whatsapp: ERROR: Error handling whatsapp message: Err: [object Object] Ou quando tento enviar uma mensagem: Err: Error: Protocol error (Runtime.callFunctionOn): Session closed.
o código que postei é somente um trecho no arquivo src/util/Injected.js, a solução completa depende de utilizar um pacote com a última correção da dependência moduleRaid que ainda não estava disponível no npm, somente no repositório, e então alterar o Injected.js
This worked for me
let modObj = {}; if (parseFloat(window.Debug.VERSION) < 2.3) { (window.webpackChunkbuild || window.webpackChunkwhatsapp_web_client).push([["parasiteijn34h82hdf"], {}, function (findMod) { // Percorrendo os módulos encontrados e adicionando-os ao objeto modObj Object.keys(findMod.m).forEach(function (mod) { modObj[mod] = findMod(mod); }) }]); } else { let modules = self.require('__debug').modulesMap; Object.keys(modules).filter(e => e.includes("WA")).forEach(function (mod) { let modulos = modules[mod]; if (modulos) { modObj[mod] = { default: modulos.defaultExport, factory: modulos.factory, ...modulos }; if (Object.keys(modObj[mod].default).length == 0) { try { self.ErrorGuard.skipGuardGlobal(true); Object.assign(modObj[mod], self.importNamespace(mod)); } catch (e) { } } } }) } register(modObj);
qual arquivo?
for me this doesnt work anymore.. uma bagunca ja estao os comits e versoes =( mesmo seguindo a documentacao tens q fazer varias outras funcoes pra funcionar, e depois de um temp ja deixa de funcionar outra vez :...(
Funcionou pra mim fazendo: Alterando em: webCache/LocalWebCache.js a linha 34; De: const version = indexHtml.match(/manifest-([\d.]+).json/)[1]; Para: const version = indexHtml.match(/manifest.json/)[1]; Depois fui em moduleRaid na lib node_modules/@pedroslopez/moduleraid e fiz a modificação do Devaec
Aqui pra min não funcionou e agora esta apresentando este erro :
ERROR: Error handling whatsapp message: Err: Error: Evaluation failed: Error: Data passed to getter must include an id property (it's how we memoize) but got undefined
0|whaticket-backend | at new Error (
Alguem consegue me ajudar ?
This worked for me
let modObj = {}; if (parseFloat(window.Debug.VERSION) < 2.3) { (window.webpackChunkbuild || window.webpackChunkwhatsapp_web_client).push([["parasiteijn34h82hdf"], {}, function (findMod) { // Percorrendo os módulos encontrados e adicionando-os ao objeto modObj Object.keys(findMod.m).forEach(function (mod) { modObj[mod] = findMod(mod); }) }]); } else { let modules = self.require('__debug').modulesMap; Object.keys(modules).filter(e => e.includes("WA")).forEach(function (mod) { let modulos = modules[mod]; if (modulos) { modObj[mod] = { default: modulos.defaultExport, factory: modulos.factory, ...modulos }; if (Object.keys(modObj[mod].default).length == 0) { try { self.ErrorGuard.skipGuardGlobal(true); Object.assign(modObj[mod], self.importNamespace(mod)); } catch (e) { } } } }) } register(modObj);
let modObj = {};
This worked for me
Creo q os PR poderiam planificar um fix para o main, pq fazer o clone e depois ter que modificar os modulos nao eh legal 🫠
Please, havia comentado de uma mudança q whatsapp havia comentado 🫣 ehbum package maravilhoso e merece nao ser descontinuado 😇
Isso funcionou para mim
let modObj = {}; if (parseFloat(window.Debug.VERSION) < 2.3) { (window.webpackChunkbuild || window.webpackChunkwhatsapp_web_client).push([["parasiteijn34h82hdf"], {}, function (findMod) { // Percorrendo os módulos encontrados e adicionando-os ao objeto modObj Object.keys(findMod.m).forEach(function (mod) { modObj[mod] = findMod(mod); }) }]); } else { let modules = self.require('__debug').modulesMap; Object.keys(modules).filter(e => e.includes("WA")).forEach(function (mod) { let modulos = modules[mod]; if (modulos) { modObj[mod] = { default: modulos.defaultExport, factory: modulos.factory, ...modulos }; if (Object.keys(modObj[mod].default).length == 0) { try { self.ErrorGuard.skipGuardGlobal(true); Object.assign(modObj[mod], self.importNamespace(mod)); } catch (e) { } } } }) } register(modObj);
deixe modObj = {};
Isso funcionou para mim
E qual seria o caminho para esse arquivo?
Isso funcionou para mim
let modObj = {}; if (parseFloat(window.Debug.VERSION) < 2.3) { (window.webpackChunkbuild || window.webpackChunkwhatsapp_web_client).push([["parasiteijn34h82hdf"], {}, function (findMod) { // Percorrendo os módulos encontrados e adicionando-os ao objeto modObj Object.keys(findMod.m).forEach(function (mod) { modObj[mod] = findMod(mod); }) }]); } else { let modules = self.require('__debug').modulesMap; Object.keys(modules).filter(e => e.includes("WA")).forEach(function (mod) { let modulos = modules[mod]; if (modulos) { modObj[mod] = { default: modulos.defaultExport, factory: modulos.factory, ...modulos }; if (Object.keys(modObj[mod].default).length == 0) { try { self.ErrorGuard.skipGuardGlobal(true); Object.assign(modObj[mod], self.importNamespace(mod)); } catch (e) { } } } }) } register(modObj);
deixe modObj = {};
Isso funcionou para mim
E qual seria o caminho para esse arquivo?
for me this worked
const wwebVersion = '2.2407.3';
const client = new Client({
authStrategy: new LocalAuth(), // your authstrategy here
puppeteer: {
// puppeteer args here
},
webVersionCache: {
type: 'remote',
remotePath: `https://raw.githubusercontent.com/wppconnect-team/wa-version/main/html/${wwebVersion}.html`,
},
});
What worked for me:
Get the moduleraid.js file from this link https://github.com/wwebjs/moduleRaid
And apply the changes from https://github.com/pedroslopez/whatsapp-web.js/issues/2789#issuecomment-2034553600 and https://github.com/pedroslopez/whatsapp-web.js/issues/2789#issuecomment-2034333596 comments.
It's working perfectly.
could anyone make a PR with the solution?
Código completo aqui nesta PR abaixo, mas precisa de compilar o moduleRaid e instalar pelo .tgz dele. PR 2882
const wwebVersion = '2.2407.3'; const client = new Client({ authStrategy: new LocalAuth(), // your authstrategy here puppeteer: { // puppeteer args here }, webVersionCache: { type: 'remote', remotePath: `https://raw.githubusercontent.com/wppconnect-team/wa-version/main/html/${wwebVersion}.html`, }, });
Relevant wweb versions can be found here
this worked for me
Isso funcionou para mim
let modObj = {}; if (parseFloat(window.Debug.VERSION) < 2.3) { (window.webpackChunkbuild || window.webpackChunkwhatsapp_web_client).push([["parasiteijn34h82hdf"], {}, function (findMod) { // Percorrendo os módulos encontrados e adicionando-os ao objeto modObj Object.keys(findMod.m).forEach(function (mod) { modObj[mod] = findMod(mod); }) }]); } else { let modules = self.require('__debug').modulesMap; Object.keys(modules).filter(e => e.includes("WA")).forEach(function (mod) { let modulos = modules[mod]; if (modulos) { modObj[mod] = { default: modulos.defaultExport, factory: modulos.factory, ...modulos }; if (Object.keys(modObj[mod].default).length == 0) { try { self.ErrorGuard.skipGuardGlobal(true); Object.assign(modObj[mod], self.importNamespace(mod)); } catch (e) { } } } }) } register(modObj);
deixe modObj = {};
Isso funcionou para mim
E qual seria o caminho para esse arquivo?
Funcionou pra mim fazendo: Alterando em: webCache/LocalWebCache.js a linha 34; De: const version = indexHtml.match(/manifest-([\d.]+).json/)[1]; Para: const version = indexHtml.match(/manifest.json/)[1]; Depois fui em moduleRaid na lib node_modules/@pedroslopez/moduleraid e fiz a modificação do Devaec
I found new bugs
D:\whatsapp-api\node_modules\puppeteer\lib\cjs\puppeteer\common\DOMWorld.js:528
const timeoutError = new Errors_js_1.TimeoutError(waiting for ${options.title} failed: timeout ${options.timeout}ms exceeded
);
^
TimeoutError: waiting for function failed: timeout 30000ms exceeded at new WaitTask (D:\whatsapp-api\node_modules\puppeteer\lib\cjs\puppeteer\common\DOMWorld.js:528:34) at DOMWorld.waitForFunction (D:\whatsapp-api\node_modules\puppeteer\lib\cjs\puppeteer\common\DOMWorld.js:479:26) at Frame.waitForFunction (D:\whatsapp-api\node_modules\puppeteer\lib\cjs\puppeteer\common\FrameManager.js:1010:32) at Page.waitForFunction (D:\whatsapp-api\node_modules\puppeteer\lib\cjs\puppeteer\common\Page.js:2490:33) at Client.initialize (D:\whatsapp-api\node_modules\whatsapp-web.js\src\Client.js:333:20) at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
Node.js v21.7.1
i got this error after scan qr code
my client config using
webVersionCache: {
type: 'remote',
remotePath: "https://raw.githubusercontent.com/wppconnect-team/wa-version/main/html/2.2402.5.html",
},
hi guys dont waste time, this is the solution that worked for me: https://github.com/pedroslopez/whatsapp-web.js/pull/2816
hi guys dont waste time, this is the solution that worked for me: #2816
But how can i implement it? It's already in the npm latest version?
Is there an existing issue for this?
Describe the bug
Three days ago I started to receive the following error on account start:
Evaluation failed: TypeError: Cannot read properties of undefined (reading 'push')\n at fillModuleArray (eval at <anonymous> (:2:5), <anonymous>:6:74)\n at moduleRaid (eval at <anonymous> (:2:5), <anonymous>:15:3)\n at puppeteer_evaluation_script:4:17
Expected behavior
As a user, I expect to be logged in and able to send messages. But I am seeing desribed error.
Steps to Reproduce the Bug or Issue
Relevant Code
No response
Browser Type
Chromium
WhatsApp Account Type
Standard
Does your WhatsApp account have multidevice enabled?
Yes, I am using Multi Device
Environment
OS: Linux and Windows whatsapp-web.js version: latest, installed directly from GitHub (https://github.com/pedroslopez/whatsapp-web.js/commit/ef2f725bce1bd1afd8491f9de0cd2ed06a6febc3) WhatsApp Web version: 2.3000.1011643235 Node.js version: v18.19.0
Additional context
moduleraid
library (Related issue - https://github.com/pedroslopez/moduleRaid/issues/5)