-3
I wanted to ask for help to solve this problem. I am taking a course of React Native online but the instructor does not answer my questions. I am unable to find the problem. Follow the error:
[nodemon] restarting due to changes...
[nodemon] starting `node src/index.js`
C:\Users\Administrador\APP-REACT\node_modules\express\lib\router\route.js:202
throw new Error(msg);
^
Error: Route.post() requires a callback function but got a [object Undefined]
at Route.<computed> [as post] (C:\Users\Administrador\APP-REACT\node_modules\express\lib\router\route.js:202:15)
at Function.proto.<computed> [as post] (C:\Users\Administrador\APP-REACT\node_modules\express\lib\router\index.js:510:19)
at Object.<anonymous> (C:\Users\Administrador\APP-REACT\src\routes\TaskRoutes.js:6:8)
at Module._compile (internal/modules/cjs/loader.js:1138:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1158:10)
at Module.load (internal/modules/cjs/loader.js:986:32)
at Function.Module._load (internal/modules/cjs/loader.js:879:14)
at Module.require (internal/modules/cjs/loader.js:1026:19)
at require (internal/modules/cjs/helpers.js:72:18)
at Object.<anonymous> (C:\Users\Administrador\APP-REACT\src\index.js:5:21)
at Module._compile (internal/modules/cjs/loader.js:1138:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1158:10)
at Module.load (internal/modules/cjs/loader.js:986:32)
at Function.Module._load (internal/modules/cjs/loader.js:879:14)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12)
at internal/main/run_main_module.js:17:47
[nodemon] app crashed - waiting for file changes before starting...
If you need more details, just say so. I’ll pass on the code images. Thank you.
Could post the code?
– Danizavtz
Hello, friend. What code do I need to post? I’m a beginner in React.
– Wanderson Silva
Taskroutes.js and the controller associated with it, if you have one.
– Danizavtz
Friend, I put some images. I don’t know what callback function you’re referring to.
– Wanderson Silva
I added an answer, could check if it solves the problem?
– Danizavtz