DaggieBlanqx / whatsapp-ecommerce-bot

28 stars 22 forks source link

error: ReferenceError: signale is not defined #1

Open macagua opened 2 years ago

macagua commented 2 years ago

@DaggieBlanqx When configuring express server and test the webhook field messages show the following error

$ nodemon app.js
[nodemon] 2.0.19
[nodemon] to restart at any time, enter `rs`
[nodemon] watching path(s): *.*
[nodemon] watching extensions: js,mjs,json
[nodemon] starting `node app.js`
Execution environment selected is: "development"
App now running and listening on port 9000
GET: Someone is pinging me!
GET: Someone is pinging me!
POST: Someone is pinging me!
{
  error: ReferenceError: signale is not defined
      at module.exports (/home/macagua/proyectos/odoo/extra-addons/chatbot/whatsapp-ecommerce-bot/pidela-whatsapp-bot/node_modules/whatsappcloudapi_wrapper/msg_parser.js:17:9)
      at WhatsappCloud.parseMessage (/home/macagua/proyectos/odoo/extra-addons/chatbot/whatsapp-ecommerce-bot/pidela-whatsapp-bot/node_modules/whatsappcloudapi_wrapper/index.js:867:16)
      at /home/macagua/proyectos/odoo/extra-addons/chatbot/whatsapp-ecommerce-bot/pidela-whatsapp-bot/routes/index.js:43:29
      at Layer.handle [as handle_request] (/home/macagua/proyectos/odoo/extra-addons/chatbot/whatsapp-ecommerce-bot/pidela-whatsapp-bot/node_modules/express/lib/router/layer.js:95:5)
      at next (/home/macagua/proyectos/odoo/extra-addons/chatbot/whatsapp-ecommerce-bot/pidela-whatsapp-bot/node_modules/express/lib/router/route.js:144:13)
      at Route.dispatch (/home/macagua/proyectos/odoo/extra-addons/chatbot/whatsapp-ecommerce-bot/pidela-whatsapp-bot/node_modules/express/lib/router/route.js:114:3)
      at Layer.handle [as handle_request] (/home/macagua/proyectos/odoo/extra-addons/chatbot/whatsapp-ecommerce-bot/pidela-whatsapp-bot/node_modules/express/lib/router/layer.js:95:5)
      at /home/macagua/proyectos/odoo/extra-addons/chatbot/whatsapp-ecommerce-bot/pidela-whatsapp-bot/node_modules/express/lib/router/index.js:284:15
      at Function.process_params (/home/macagua/proyectos/odoo/extra-addons/chatbot/whatsapp-ecommerce-bot/pidela-whatsapp-bot/node_modules/express/lib/router/index.js:346:12)
      at next (/home/macagua/proyectos/odoo/extra-addons/chatbot/whatsapp-ecommerce-bot/pidela-whatsapp-bot/node_modules/express/lib/router/index.js:280:10)
}

My Node version is:

$ node -v
v14.15.1

How fix this error?

N0vachr0n0 commented 1 year ago

Add const signale = require('signale'); after 'use strict'; in /home/macagua/proyectos/odoo/extra-addons/chatbot/whatsapp-ecommerce-bot/pidela-whatsapp-bot/node_modules/whatsappcloudapi_wrapper/msg_parser.js

(Maybe it will help someone a day)