Whatsapp-web.js: Problem with Chromium

Created on 9 Sep 2020  Â·  4Comments  Â·  Source: pedroslopez/whatsapp-web.js

WhatsApp works with Google Chrome 49 or higher.

image

Chromium r782078

image

Library

  • Browser: Chromium r782078
  • NodeJS version: v12.15.0
  • npm or yarn version: 6.13.7
  • whatsapp-web.js version: 1.8.2
bug

All 4 comments

This error is a bug from puppeter about canvas qrcode after pairing a number...

I've sent one PR to avoid this error → https://github.com/pedroslopez/whatsapp-web.js/pull/334

Look this question -> WhatsApp Web is asking to update Chrome while using Chromium

I believe this issue is related to cookies and temporary data

I took the userDataDir out of the puppeteer and it seems to have solved the problem

Just save/restore the session:

import * as fs from "fs";
import * as util from "util";
const readFile = util.promisify(fs.readFile);
const writeFile = util.promisify(fs.writeFile);

const sessionFilePath = "./session.json";

async function initialize() {
  let session: any = undefined;
  try {
    session = JSON.parse(await readFile(sessionFilePath, 'utf-8'));
  } catch (e) {
    logger.info('Couldnt load existing session')
  }

  const client = new Client({
    puppeteer: {
      headless: process.env.HEADLESS !== 'false',
    },
    ...(session ? { session } : {})
  });  
  client.on('authenticated', (session: any) => {
    logger.info(`Authenticated: Saving session to ${sessionFilePath}`);
    writeFile(sessionFilePath, JSON.stringify(session));
  });
  client.initialize();
}
initialize();
Was this page helpful?
0 / 5 - 0 ratings

Related issues

waltergammarota picture waltergammarota  Â·  8Comments

ncesar picture ncesar  Â·  7Comments

centralderastreamentogps picture centralderastreamentogps  Â·  7Comments

andersondeoliveiramachado picture andersondeoliveiramachado  Â·  7Comments

iamshouvikmitra picture iamshouvikmitra  Â·  4Comments