FAQ: Middleware - Discovering Open-Source Middleware

This community-built FAQ covers the “Discovering Open-Source Middleware” exercise from the lesson “Middleware”.

Paths and Courses
This exercise can be found in the following Codecademy content:

Web Development

Learn Express

FAQs on the exercise Discovering Open-Source Middleware

There are currently no frequently asked questions associated with this exercise – that’s where you come in! You can contribute to this section by offering your own questions, answers, or clarifications on this exercise. Ask or answer a question by clicking reply (reply) below.

If you’ve had an “aha” moment about the concepts, formatting, syntax, or anything else with this exercise, consider sharing those insights! Teaching others and answering their questions is one of the best ways to learn and stay sharp.

Join the Discussion. Help a fellow learner on their journey.

Ask or answer a question about this exercise by clicking reply (reply) below!

Agree with a comment or answer? Like (like) to up-vote the contribution!

Need broader help or resources? Head here.

Looking for motivation to keep learning? Join our wider discussions.

Learn more about how to use this guide.

Found a bug? Report it!

Have a question about your account or billing? Reach out to our customer support team!

None of the above? Find out where to ask other questions here!

In this exercise you have to add errorhandler middleware.
I required in the middleware and set app.use(errorhandler())

Because I had no idea what to do next, I asked for the solution to the exercise. It now allows me to go to the next page. But the code hasn’t changed. To me, it doesn’t seem like a solution has been presented. am I missing something?


I was encountering the same thing. I copied and pasted the require from the documentation which uses “var”. The solution used “const”. This was the only difference and it seemed to be the key to being “right” or wrong. Maybe you did the same thing?

A few lessons on the ExpressJS are a joke here. This one included, the previous one too. You try and try and nothing seems to be working and then when you ask for the solution, it’s letter by letter, same code as yours. I think @codecademy has to work a bit on the testing unit of these lessons.

Otherwise, yes, same here. Tried, checked the work, same error kept popping up. Asked for the solution and although the code was the same, I was allowed to move on.


Same happened to me! In the end it was an issue of using ‘errorhandler’ instead of “errorhandler” in the require.

yeah this is honestly the worst module I’ve done. content AND the code is structured and explained so poorly.

1 Like

So in the error handling lesson, we are explicitly told that the error handler should be the last app.use(), yet the solution dumps it in as the third, after the logging and body-parsing middlewares.

We’re also told to replace the catch-all error handler with the new one, yet the solution replaces nothing and it’s still there at the end.

What the ■■■■ is this lesson talking about…?

1 Like