expressjs / express

Fast, unopinionated, minimalist web framework for node.
https://expressjs.com
MIT License
64.35k stars 14.63k forks source link

TypeError: res.status is not a function #4009

Closed IDONTSUDO closed 4 years ago

IDONTSUDO commented 4 years ago

*bug

*behavior I have a request.

He walks through the router. He sends it to check for two callbacks. These calbacks complement the Req data. I expect that the application will collect data from two collections. And on the basis of them will create a new collection.

If the current behavior is a bug, please provide the steps to reproduce. git clone https://github.com/IDONTSUDO/CRM- npm i npm run dev and watch video https://www.youtube.com/watch?v=0io--BhXVwk&feature=youtu.be

TypeError: res.status is not a function

at C:\Users\User\CRM\CRM-\controllers\user\Order.js:62:24

at C:\Users\User\CRM\CRM-\node_modules\mongoose\lib\model.js:4733:16

at C:\Users\User\CRM\CRM-\node_modules\mongoose\lib\utils.js:255:11

at C:\Users\User\CRM\CRM-\node_modules\mongoose\lib\query.js:4216:18

at model.Query.<anonymous> (C:\Users\User\CRM\CRM-

\node_modules\mongoose\lib\query.js:2018:5)

at model.Query._wrappedThunk [as _findOne] (C:\Users\User\CRM\CRM-

\node_modules\mongoose\lib\helpers\query\wrapThunk.js:16:8)

at C:\Users\User\CRM\CRM-\node_modules\kareem\index.js:369:33

at processTicksAndRejections (internal/process/task_queues.js:82:9)

Emitted 'error' event at:

at C:\Users\User\CRM\CRM-\node_modules\mongoose\lib\model.js:4735:13

at C:\Users\User\CRM\CRM-\node_modules\mongoose\lib\utils.js:255:11

[... lines matching original stack trace ...]

at processTicksAndRejections (internal/process/task_queues.js:82:9)

[nodemon] app crashed - waiting for file changes before starting...

What is the expected behavior?

I expected to be saved MongoDb 3.2.5 Mongoose last version Node js last version.


I created two tickets. Since I do not understand which side of the problem.

waldemarnt commented 4 years ago

Tried to reproduce but seems to be working well.

Node v12.6

logging on line 62 Order.js
POST /user/new/bookmakers/13231231/23132131 500 16.586 ms - 15
prod
IDONTSUDO commented 4 years ago

okay