As I get the same problem, although I know BodyParser
is no longer usedand I already used the app.use(express.json())
the problem was {FOR ME}:I was placing
app.use(express.json())
after
app.use('api/v1/example', example)
=> { concerns the route }
once I reorder those two lines;
1 - app.use(express.json())
2 - app.use('api/v1/example', example)
It worked perfectly