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

261
Visualizações
nunjucks wont render template JavaScript(Html)

Im trying to render a template using nunjucks!

As seen in the screenshot I'm rendering the faucet.html from inside index.js I cant render it though I get a error

Code

app.get("/", async function (req, res) {
  //return res.send(nunjucks.render('index.html', {error: "Faucet currently under upgrade and maintenance, come back later", success: false}));
  return res.send(nunjucks.render("faucet.html", {}));
});

Error

/home/runner/ForestgreenOldDataset/node_modules/nunjucks/src/environment.js:290
        err = new Error('template not found: ' + name);
              ^

Error: template not found: faucet.html
    at createTemplate (/home/runner/ForestgreenOldDataset/node_modules/nunjucks/src/environment.js:290:15)
    at next (/home/runner/ForestgreenOldDataset/node_modules/nunjucks/src/lib.js:330:7)
    at handle (/home/runner/ForestgreenOldDataset/node_modules/nunjucks/src/environment.js:329:11)
    at /home/runner/ForestgreenOldDataset/node_modules/nunjucks/src/environment.js:339:9
    at next (/home/runner/ForestgreenOldDataset/node_modules/nunjucks/src/lib.js:328:7)
    at Object.asyncIter (/home/runner/ForestgreenOldDataset/node_modules/nunjucks/src/lib.js:334:3)
    at Environment.getTemplate (/home/runner/ForestgreenOldDataset/node_modules/nunjucks/src/environment.js:321:9)
    at Environment.render (/home/runner/ForestgreenOldDataset/node_modules/nunjucks/src/environment.js:360:10)
    at Object.render (/home/runner/ForestgreenOldDataset/node_modules/nunjucks/index.js:92:14)
    at /home/runner/ForestgreenOldDataset/js/index.js:85:28

ScreenShotOfFIles

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

You need to use nunjucks.configure([path], [opts]); to tell nunjucks that your templates live at path ../src.

documentation

nunjucks.configure('../src', {
  autoescape: true,
  express: app
})
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