Open hetsalk opened 7 months ago
I'm experiencing the same issue
getting the same error
same issue here
Unfortunately it's issue by whatsapp web js and if you wanted to use this, you need to update the source. need to update the web cache + use whatsapp web js (webpack-exodus branch) inside package.js
update package.js
{
"name": "whatsapp-web-api",
"version": "1.0.0",
"description": "REST API wrapper for whatsapp-web.js",
"main": "server.js",
"scripts": {
"start": "node server.js",
"test": "jest --runInBand",
"swagger": "node swagger.js"
},
"dependencies": {
"axios": "^1.6.5",
"dotenv": "^16.3.1",
"express": "^4.18.2",
"express-rate-limit": "^6.11.2",
"qr-image": "^3.2.0",
"qrcode-terminal": "^0.12.0",
"swagger-ui-express": "^4.6.3",
"whatsapp-web.js": "pedroslopez/whatsapp-web.js#webpack-exodus"
},
"devDependencies": {
"eslint": "^8.38.0",
"eslint-config-standard": "^17.0.0",
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-n": "^15.7.0",
"eslint-plugin-promise": "^6.1.1",
"jest": "^29.5.0",
"supertest": "^6.3.3",
"swagger-autogen": "^2.23.7"
},
"keywords": [
"whatsapp",
"whatsapp-web",
"api",
"wrapper",
"rest",
"express",
"axios"
],
"author": "Christophe Hubert",
"license": "MIT",
"engines": {
"node": ">=14.17.0"
},
"repository": {
"type": "git",
"url": "https://github.com/chrishubert/whatsapp-web-api.git"
},
"bugs": {
"url": "https://github.com/chrishubert/whatsapp-web-api/issues"
},
"homepage": "https://github.com/chrishubert/whatsapp-web-api",
"private": true
}
inside docker-compose.yaml
from
app:
container_name: whatsapp_web_api
image: chrishubert/whatsapp-web-api:latest # Pull the image from Docker Hub
to
app:
container_name: whatsapp_web_api
build:
context: . #do
dockerfile: Dockerfile
and the environment add
environment:
- WEB_VERSION_CACHE_TYPE=REMOTE
- WEB_VERSION=2.3000.1012536975-alpha
Dockerfile change to
# Use the official Node.js Alpine image as the base image
FROM node:20-alpine
# Set the working directory
WORKDIR /usr/src/app
# Install Chromium and Git
ENV CHROME_BIN="/usr/bin/chromium-browser" \
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD="true" \
NODE_ENV="production"
RUN set -x \
&& apk update \
&& apk upgrade \
&& apk add --no-cache \
udev \
ttf-freefont \
chromium \
git
# Copy package.json and package-lock.json to the working directory
COPY package*.json ./
# Install the dependencies
RUN npm install --only=production
# Copy the rest of the source code to the working directory
COPY . .
# Expose the port the API will run on
EXPOSE 3000
# Start the API
CMD ["npm", "start"]
later just docker compose up will do.
I managed to resolve here #190
this temp solution is working I did:
pedroslopez/whatsapp-web.js#webpack-exodus
Im running not via docker, but using npm run start
command
Thanks!
Hello ,How Can Deploy this Code in Vps Server ?
This work for me, for windows 10 and im running not via docker and still using npm run start
WEB_VERSION_CACHE_TYPE=local
npm uninstall whatsapp-web.js
npm install github:pedroslopez/whatsapp-web.js#webpack-exodus
Please use the latest docker version 🙏
Even after doing all the tips shown here, I'm unable to connect the number. Callback shows:
{"dataType":"loading_screen","data":{"percent":100,"message":"WhatsApp"},"sessionId":"1"} {"dataType":"loading_screen","data":{"percent":0,"message":"WhatsApp"},"sessionId":"1"} {"dataType":"loading_screen","data":{"percent":0,"message":"WhatsApp"},"sessionId":"1"} {"dataType":"loading_screen","data":{"percent":0,"message":"WhatsApp"},"sessionId":"1"} {"dataType":"loading_screen","data":{"percent":72,"message":"WhatsApp"},"sessionId":"1"} {"dataType":"loading_screen","data":{"percent":95,"message":"WhatsApp"},"sessionId":"1"} {"dataType":"loading_screen","data":{"percent":99,"message":"WhatsApp"},"sessionId":"1"}
v21.7.3
10.5.0
npm WARN deprecated puppeteer@18.2.1: < 21.8.0 is no longer supported
whatsapp-web-api@1.0.0 start node server.js
(node:1123768) [DEP0040] DeprecationWarning: The punycode
module is deprecated. Please use a userland alternative instead.
at node:punycode:3:9
at BuiltinModule.compileForInternalLoader (node:internal/bootstrap/realm:398:7)
at BuiltinModule.compileForPublicLoader (node:internal/bootstrap/realm:337:10)
at loadBuiltinModule (node:internal/modules/helpers:104:7)
at Module._load (node:internal/modules/cjs/loader:999:17)
at Module.require (node:internal/modules/cjs/loader:1230:19)
at require (node:internal/modules/helpers:179:18)
at Object.
I've noticed that when installing github:pedroslopez/whatsapp-web.js#webpack-exodus, npm tries to install an old puppeter version (18.2.1), which seems not being supported anymore. May this be the trick? How to fix it?
Please help.
Thanks
getting the same error
no update yet :(
this temp solution is working I did:
- updated package,json to
pedroslopez/whatsapp-web.js#webpack-exodus
- changed variables WEB_VERSION_CACHE_TYPE=REMOTE, WEB_VERSION=2.3000.1012536975-alpha
Im running not via docker, but using
npm run start
commandThanks!
still not working, always ssession_not_connected
Please use the latest docker version 🙏
After update with latest version after connected and i check sessions return
{ "success": false, "state": null, "message": "browser tab closed" }
any update?
2.3000.1012536975-alpha
I am solved with change docker env
- RATE_LIMIT_MAX=1000 - RATE_LIMIT_WINDOW_MS=1000 - WEB_VERSION='2.3000.1012536975-alpha' - WEB_VERSION_CACHE_TYPE=remote - RECOVER_SESSIONS=TRUE
2.3000.1012536975-alpha
I am solved with change docker env
- RATE_LIMIT_MAX=1000
- RATE_LIMIT_WINDOW_MS=1000
- WEB_VERSION='2.3000.1012536975-alpha'
- WEB_VERSION_CACHE_TYPE=remote
- RECOVER_SESSIONS=TRUE
working with non-docker package!! thanks!!
Is the problem found?
Is the problem found?
not sure, but i success with trick like here https://github.com/chrishubert/whatsapp-api/issues/189#issuecomment-2089405230
When I scan Qr code it successfully scanned. in mobile it show connected (Active) but when i hit status check api it gave session_not connected status. So please guide me.
It gave Below error in terminal that
Initialize error: Evaluation failed: TypeError: Cannot read properties of undefined (reading 'default') at puppeteer_evaluation_script:5:95