Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

195
Views
Express route not working but deliberate error in code shows it is being called correctly

I have a very strange problem with an Express route whereby a perfectly valid console.log does not display and no other lines of code after it execute when the route is hit.

For example:

app.get('/api/v1/users', (req, res) => {
   console.log('Users route has been reached....') // does not display in console
   ...
  // No other code executes
}

However, to test if the route is actually being hit I purposely created an error in the console.log like so:

console.log('Route has been reached....) // missing end quote

And when I check the logs, I can see the following error.

0|index | /home/ubuntu/apps/api/server/index.js:119 0|index | console.log('Route has been reached........) 0|index | ^^^^^^^^^^^^^^^^^^^^^^^ 0|index | 0|index | SyntaxError: Invalid or unexpected token

This must mean that the route is being hit correctly but for some reason doesn't execute its request properly. My logic is that if the line with the bad console.log is reached then I cannot see why the correct one doesn't even log out at all.

I am a bit stumped as to what is going on so any ideas or assistance on what the problem could be is very welcome.

Thanks!

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!