Estoy utilizando la documentación por defecto de la api de "WhatsApp web js" y al momento de aplicar el código
console.log("no ahi conecxion ")
const client = new Client();
client.on('qr', qr => {
qrcode.generate(qr, { small: true });
});
client.on('authenticated', (session) => {
sessionData = session;
fs.writeFile(SESSION_FILE_PATH, JSON.stringify(session), (err) => {
if (err) {
console.error(err);
}
});
});
client.initialize();
al momento de que se escanea el qr, me sale el siguiente error
node:internal/errors:464
ErrorCaptureStackTrace(err);
^
TypeError [ERR_INVALID_ARG_TYPE]: The "data" argument must be of type string or an instance of Buffer, TypedArray, or DataView. Received undefined
at Object.writeFile (node:fs:2106:5)
at Client.<anonymous> (C:\Users\Brian\OneDrive\Escritorio\Bot\app.js:24:12)
at Client.emit (node:events:390:28)
at Client.initialize (C:\Users\Brian\OneDrive\Escritorio\Bot\node_modules\whatsapp-web.js\src\Client.js:223:14)
at processTicksAndRejections (node:internal/process/task_queues:96:5) {
code: 'ERR_INVALID_ARG_TYPE' }