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

259
Vistas
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 Respuestas
Responde la pregunta

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