Wednesday, 24 May 2017

Nunjucks - Error: template not found:

The template exists exactly where it's supposed to and the path.join is pointed directly to it. Yet still getting a Error: template not found:. Also tried using path.resolve but gives the same error. Incidentally I'm using exactly the same structure in another file and it works without any problems. Any ideas? Cheers!

var deferred = q.defer();
nunjucks.render(path.join(__dirname, 'form.html'), {
          form: extraStuff
        }, function (err, html) {
          if (err) {
            console.log('Nunjucks returns error here....');
            return deferred.reject(err);
          }
          console.log('RENDERING....');
          deferred.resolve(html);
        });



via mikeym

No comments:

Post a Comment