Closed bunchito closed 2 years ago
Whats the order of your imports/requires?
Thanks, @kronicker Your comment helped me to resolve the issue. It was the last (bottom). I moved it first (top) and now everything works as expected.
No problem. Since it's patching express it should be required right after express
.
I'm trying this package but I cannot make it work with the "Express Error Middleware".
src/routes/users.js
src/index.js
When I make a GET request to http://127.0.0.1:3333/users I see:
In the console
The application crushes and process exits. There is not hitting the express error middleware and there is no 500 response.
If I create my own async handler and wrap the user route, the express error middleware works: src/routes/users.js
When I make a GET request to http://127.0.0.1:3333/users I see:
In the console
And I receive a
500
response with the textSomething broke!
How can I achieve this behavior with this library? Thanks!