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

172
Visualizações
EJS Element not showing up

Hi I am having an issue with my EJS error message. Each time the error is passed through, the error message is supposed to be brought into the page but never does. No errors or anything. I debugged a bit and figured out that the res.render wasn't working.

EJS:

<% if(typeof error != "undefined") { %>
    <%= console.log(error) %>
    <div class="py-8 px-6">
        <div class="p-6 border-l-4 border-orange-600 bg-orange-500 rounded-r-lg">
            <div class="flex items-center">
                <span class="inline-block mr-2">
                    <svg width="24" height="20" viewbox="0 0 24 20" fill="none" xmlns="http://www.w3.org/2000/svg" data-config-id="auto-svg-1-10"></svg>
                </span>
                <h3 class="text-white font-medium" data-config-id="header"><%= error %></h3>
                <button class="ml-auto">
                    <svg class="text-orange-800" width="12" height="12" viewbox="0 0 12 12" fill="none" xmlns="http://www.w3.org/2000/svg" data-config-id="auto-svg-2-10"></svg>
                </button>
            </div>
        </div>
    </div>
<% } %>

My API:

if (plainPassword.length < 6) {
    error = "Password must be 6 or more characters";
    return res.render("signup", { error, username, plainPassword, plainEmail })
}

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