Estoy tratando de ejecutar un trabajo cron en Heroku que se ejecuta a diario. La versión de nodo que utiliza este servidor/proyecto de Heroku es v9.4. También estoy usando el paquete asíncrono v2.6.1
Cuando ejecuto el archivo usando el nodo: node dist/filename.js Da un error y ya no ejecuta el archivo:
superagent: Enable experimental feature http2 (node:8233) ExperimentalWarning: The http2 module is an experimental API. Connected to mongo database { Error: certificate has expired at TLSSocket.onConnectSecure (_tls_wrap.js:1046:34) at TLSSocket.emit (events.js:180:13) at TLSSocket._finishInit (_tls_wrap.js:633:8) code: 'CERT_HAS_EXPIRED', response: undefined } (node:8233) UnhandledPromiseRejectionWarning: Error: certificate has expired at TLSSocket.onConnectSecure (_tls_wrap.js:1046:34) at TLSSocket.emit (events.js:180:13) at TLSSocket._finishInit (_tls_wrap.js:633:8) (node:8233) 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(). (rejection id: 1) (node:8233) [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.Seguí adelante e intenté agregar un bloque de captura de prueba dentro del bloque asíncrono, pero aún arroja el mismo error.
import async from "async"; . . . function iterateAndGenStats(userData) { async.eachSeries(userData, (user, cb) => { try { . . . cb(); } catch (err) { console.log(err); } }, () => { cronSlackService.CronSuccessUpdate( `statistics for applications have been generated. Details are provided below ...`, ); } ); }Si tuviera que usar el nodo v12 y ejecutar el mismo comando, funciona bien sin errores. Solo sucede cuando cambio al nodo v9 donde ocurre este error. La única idea que me viene a la mente es actualizar la versión de nodo de mi proyecto de servidor para evitar este error.