Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error en /api/send #8

Closed
NRotili opened this issue Feb 21, 2022 · 5 comments
Closed

Error en /api/send #8

NRotili opened this issue Feb 21, 2022 · 5 comments

Comments

@NRotili
Copy link

NRotili commented Feb 21, 2022

Hola Leifer, cómo estás? Mi nombre es Nicolás y te agradezco una vez más por tus grandiosos videos y repos.

Estoy teniendo un error al enviar desde postman a https://localhost:3000/api/send mediante POST.

(node:6428) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'replace' of null at cleanNumber (C:\xampp\htdocs\bot-whatsapp\controllers\handle.js:8:21) at Timeout._onTimeout (C:\xampp\htdocs\bot-whatsapp\controllers\send.js:31:14) at listOnTimeout (internal/timers.js:554:17) at processTimers (internal/timers.js:497:7) (Usenode --trace-warnings ...to show where the warning was created) (node:6428) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag--unhandled-rejections=strict(see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1) (node:6428) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Sin embargo, la respuesta desde la API es "Enviado!"

Qué puede estar ocurriendo?

Gracias de antemano!

@leifermendez
Copy link
Member

@NRotili lo reviso pero una idea para debugear es en esta linea de este archivo "controllers\send.js:31" igual en un rato que tenga un tiempo lo reviso

@NRotili
Copy link
Author

NRotili commented Feb 21, 2022

En "controllers\send.js:31" está todo correcto, el problema está en que sendMessagePost() no está recibiendo los valores enviados desde postman, y al enviar NULL a sendMessage() en number, se genera este conflicto.

@leifermendez
Copy link
Member

image
Revisa que estes enviando los datos de la siguiente manera

@NRotili
Copy link
Author

NRotili commented Feb 21, 2022

Error mío, estaba pasando los datos como x-www-form-urencoded.
Un éxito funcionando con raw.
Gracias Leifer por tanto.

@untakereduardo
Copy link

Ante todo muchas gracias. Estoy teniendo un problema parecido. Me arroja un error en Controller->Send.js->sendMessage linea 50 me indica que client es nulo. A que se debe?
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants