Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

172
Vistas
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?

over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

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>
        <% } %>


over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda