Skip to content

[WEBJS] - GET /api/{session}/channels - TypeError: Cannot read properties of undefined (reading 'getModelsArray') #1883

@daigorl

Description

@daigorl

When calling the /api/{session}/channels endpoint using the WEBJS engine, the API returns a 500 Internal Server Error. This seems to be related to a breaking change in the WhatsApp Web internal structure that whatsapp-web.js (and WAHA) uses to fetch channel information.

Side effect: Unable to send messages to @newsletter

Version

{
  "version": "2026.1.3",
  "engine": "WEBJS",
  "tier": "CORE",
  "browser": "/usr/bin/chromium",
  "platform": "linux/x64"
}

Steps

Steps to Reproduce

  1. Start WAHA with WEBJS engine.
  2. Authenticate a session (e.g., default).
  3. Make a GET request to /api/default/channels.
  4. See error response.

Expected behavior

The API should return a list of WhatsApp Channels for the session.

Actual behavior

The API returns a 500 Error with the message: Cannot read properties of undefined (reading 'getModelsArray').

Requests - Responses

{
  "statusCode": 500,
  "timestamp": "2026-02-02T18:46:33.736Z",
  "exception": {
    "message": "Cannot read properties of undefined (reading 'getModelsArray')",
    "name": "TypeError",
    "stack": "TypeError: Cannot read properties of undefined (reading 'getModelsArray')\n    at window.WWebJS.getChannels (evaluate at WPage.evaluate (/app/dist/core/engines/webjs/WPage.js:13:36), <anonymous>:631:59)\n    at evaluate (evaluate at WPage.evaluate (/app/dist/core/engines/webjs/WPage.js:13:36), <anonymous>:1:39)\n    at #evaluate (/app/node_modules/puppeteer-core/lib/cjs/puppeteer/cdp/ExecutionContext.js:391:56)\n    at async ExecutionContext.evaluate (/app/node_modules/puppeteer-core/lib/cjs/puppeteer/cdp/ExecutionContext.js:277:16)\n    at async IsolatedWorld.evaluate (/app/node_modules/puppeteer-core/lib/cjs/puppeteer/cdp/IsolatedWorld.js:100:16)\n    at async CdpFrame.evaluate (/app/node_modules/puppeteer-core/lib/cjs/puppeteer/api/Frame.js:362:20)\n    at async CdpPage.evaluate (/app/node_modules/puppeteer-core/lib/cjs/puppeteer/api/Page.js:818:20)\n    at async WPage.evaluate (/app/dist/core/engines/webjs/WPage.js:13:20)\n    at async WebjsClientCore.getChannels (/app/node_modules/whatsapp-web.js/src/Client.js:1191:26)\n    at async WhatsappSessionWebJSCore.channelsList (/app/dist/core/engines/webjs/session.webjs.core.js:886:22)\n    at async descriptor.value (/app/dist/core/abc/activity.js:9:20)"
  },
  "request": {
    "path": "/api/default/channels",
    "method": "GET",
    "query": {}
  },
  "version": {
    "version": "2026.1.3",
    "engine": "WEBJS",
    "tier": "CORE",
    "browser": "/usr/bin/chromium",
    "platform": "linux/x64"
  }
}

Docker Log

{"level":30,"time":1770058074325,"pid":48,"hostname":"dcc6367043b1","reqId":244,"req":{"id":244,"method":"GET","url":"/api/default/channels","query":{},"params":{"path":["api","default","channels"]}},"res":{"statusCode":500},"err":{"type":"Error","message":"Cannot read properties of undefined (reading 'getModelsArray')","stack":"TypeError: Cannot read properties of undefined (reading 'getModelsArray')\n    at window.WWebJS.getChannels (evaluate at WPage.evaluate (/app/dist/core/engines/webjs/WPage.js:13:36), <anonymous>:631:59)\n    at evaluate (evaluate at WPage.evaluate (/app/dist/core/engines/webjs/WPage.js:13:36), <anonymous>:1:39)\n    at #evaluate (/app/node_modules/puppeteer-core/lib/cjs/puppeteer/cdp/ExecutionContext.js:391:56)\n    at async ExecutionContext.evaluate (/app/node_modules/puppeteer-core/lib/cjs/puppeteer/cdp/ExecutionContext.js:277:16)\n    at async IsolatedWorld.evaluate (/app/node_modules/puppeteer-core/lib/cjs/puppeteer/cdp/IsolatedWorld.js:100:16)\n    at async CdpFrame.evaluate (/app/node_modules/puppeteer-core/lib/cjs/puppeteer/api/Frame.js:362:20)\n    at async CdpPage.evaluate (/app/node_modules/puppeteer-core/lib/cjs/puppeteer/api/Page.js:818:20)\n    at async WPage.evaluate (/app/dist/core/engines/webjs/WPage.js:13:20)\n    at async WebjsClientCore.getChannels (/app/node_modules/whatsapp-web.js/src/Client.js:1191:26)\n    at async WhatsappSessionWebJSCore.channelsList (/app/dist/core/engines/webjs/session.webjs.core.js:886:22)\n    at async descriptor.value (/app/dist/core/abc/activity.js:9:20)","name":"TypeError"},"responseTime":5,"msg":"request errored"}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions