Environment
- whatsapp-web.js version: 1.34.2 (also tested with 1.33.2)
- puppeteer version: 22.15.0 (also tested with 19.7.5)
- Node.js version: 18 (Docker) / 20 (local compilation)
- Operating System: Ubuntu 22.04 (Docker), Windows 11 (local testing)
- Browser: Chromium (puppeteer bundled) and Google Chrome stable
Problem Description
Sessions authenticate successfully but never reach the "ready" state after container/server restart. This only affects reconnection - initial connection works perfectly.
Working: Initial Connection (2 Months ago) ✅
- Session created with
client.initialize() qrevent fires → QR code generated- User scans QR code
authenticatedevent firesreadyevent fires ✅- Messages can be sent successfully
Failing: Reconnection After Restart ❌
- Server/container restarts
- Session loads from saved data (LocalAuth)
authenticatedevent firesreadyevent NEVER fires ❌window.Storeremains undefined- Attempting to send messages fails with:
TypeError: Cannot read properties of undefined (reading 'getChat')
Reproduction Steps
- Create a new session:
const client = new Client({
authStrategy: new LocalAuth({
clientId: sessionId,
dataPath: path.join(SESSIONS_DIR, sessionId),
}),
puppeteer: {
args: [
"--no-sandbox",
"--disable-setuid-sandbox",
"--disable-dev-shm-usage",
"--disable-accelerated-2d-canvas",
"--no-first-run",
"--disable-extensions",
"--disable-gpu",
],
headless: true,
executablePath: process.env.DOCKER_ENV === 'true'
? '/usr/bin/google-chrome-stable'
: undefined,
},
takeoverOnConflict: true,
});
client.initialize();
- Scan QR code → Works perfectly,
readyevent fires - Restart server/container
- Session loads automatically but
readynever fires
In case you're reading , message adding rest of information is on demand