Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

164
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda