express-microservice-boilerplate icon indicating copy to clipboard operation
express-microservice-boilerplate copied to clipboard

UnhandledPromiseRejectionWarning: TypeError: mongoConnection.model is not a function

Open Aquazee opened this issue 3 years ago • 0 comments

(node:79684) UnhandledPromiseRejectionWarning: TypeError: mongoConnection.model is not a function at Users.setDbModel (/Users/sds-sudip.sharma/Documents/Projects/Example/express-microservice-boilerplate-develop/build/src/models/users.js:36:43) at new Users (/Users/sds-sudip.sharma/Documents/Projects/Example/express-microservice-boilerplate-develop/build/src/models/users.js:17:14) at Function.getInstance (/Users/sds-sudip.sharma/Documents/Projects/Example/express-microservice-boilerplate-develop/build/src/models/users.js:21:26) at /Users/sds-sudip.sharma/Documents/Projects/Example/express-microservice-boilerplate-develop/build/src/controllers/mongo.js:15:51 at Generator.next () at /Users/sds-sudip.sharma/Documents/Projects/Example/express-microservice-boilerplate-develop/build/src/controllers/mongo.js:8:71 at new Promise () at __awaiter (/Users/sds-sudip.sharma/Documents/Projects/Example/express-microservice-boilerplate-develop/build/src/controllers/mongo.js:4:12) at mongoController (/Users/sds-sudip.sharma/Documents/Projects/Example/express-microservice-boilerplate-develop/build/src/controllers/mongo.js:14:39) at Layer.handle [as handle_request] (/Users/sds-sudip.sharma/Documents/Projects/Example/express-microservice-boilerplate-develop/node_modules/express/lib/router/layer.js:95:5) at next (/Users/sds-sudip.sharma/Documents/Projects/Example/express-microservice-boilerplate-develop/node_modules/express/lib/router/route.js:137:13) at Route.dispatch (/Users/sds-sudip.sharma/Documents/Projects/Example/express-microservice-boilerplate-develop/node_modules/express/lib/router/route.js:112:3) at Layer.handle [as handle_request] (/Users/sds-sudip.sharma/Documents/Projects/Example/express-microservice-boilerplate-develop/node_modules/express/lib/router/layer.js:95:5) at /Users/sds-sudip.sharma/Documents/Projects/Example/express-microservice-boilerplate-develop/node_modules/express/lib/router/index.js:281:22 at Function.process_params (/Users/sds-sudip.sharma/Documents/Projects/Example/express-microservice-boilerplate-develop/node_modules/express/lib/router/index.js:335:12) at next (/Users/sds-sudip.sharma/Documents/Projects/Example/express-microservice-boilerplate-develop/node_modules/express/lib/router/index.js:275:10) (node:79684) 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:79684) [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.

Aquazee avatar Dec 20 '21 06:12 Aquazee