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

171
Views
Unexpected ';' while compiling ejs file that does not have ';' at all

I am getting this error in this file for a while now, and I can't understand the reason. I don't even have a semi-colon in this file

<section class="content">
        <% switch(page){ %>
          <% case : "userpage" %>
          <div><%- include("all_users")  %></div>
          <% break %>
          <% case : "postpage" %>
          <div><%- include("all_posts")  %></div>
          <% break %>
          <% default : %>
          <div><%- include("card") %></div>
        <% } %>
</section>

When page = "dashboard" it is going to include card.ejs file that too does not even have semi-colon. What is it that I am doing wrong here?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

My guess is that, the statement :

<% switch(page){ %>

is compiled as a seperate statement, and a ; is appended after it. Put it in the same bracket (<%) as the first case statement and it should work:

  <% switch(page){
          case : "userpage" %>
          <div><%- include("all_users")  %></div>
          <% break;
          case : "postpage" %>
          <div><%- include("all_posts")  %></div>
          <% break;
          default : %>
          <div><%- include("card") %></div>
        <% } %>


about 4 years ago · Juan Pablo Isaza Report
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!