WhatsApp works with Google Chrome 49 or higher.

Chromium r782078

Library
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();