title: Using Nunjucks with Express 4
body: <p>I am trying to use <a href="https://mozilla.github.io/nunjucks/" rel="noreferrer">Nunjucks</a> as a template engine from <a href="https://expressjs.com/" rel="noreferrer">Express</a>. I did this:</p>
  
  <pre><code>var express = require('express');
  var nunjucks = require('nunjucks');
  var path = require('path');
  var bodyParser = require('body-parser');
  var load = require('express-load');
  var fs = require("fs");
  
  var app = express();
  app.set('views', path.join(__dirname, 'views'));
  
  var env = nunjucks.configure(app.get('views'), {
      autoescape: true,
      express:    app 
  });
  
  app.set('view engine', 'html');
  </code></pre>
  
  <p>But above code gives this error:</p>
  
  <pre><code>Template render error: compileExtends: cannot extend multiple times
     at Error.exports.TemplateError (C:\my\nodejs\projects\\node_modules\nunjucks\src\lib.js:49:19)
     at Object.extend.fail (C:\my\nodejs\projects\\node_modules\nunjucks\src\compiler.js:49:15)
     at Object.extend.compileExtends (C:\my\nodejs\projects\\node_modules\nunjucks\src\compiler.js:983:18)
     at Object.extend.compile (C:\my\nodejs\projects\\node_modules\nunjucks\src\compiler.js:1083:22)
     at Object.extend._compileChildren (C:\my\nodejs\projects\\node_modules\nunjucks\src\compiler.js:139:18)
     at Object.extend.compileRoot (C:\my\nodejs\projects\\node_modules\nunjucks\src\compiler.js:1050:14)
     at Object.extend.compile (C:\my\nodejs\projects\\node_modules\nunjucks\src\compiler.js:1083:22)
     at Object.module.exports.compile (C:\my\nodejs\projects\\node_modules\nunjucks\src\compiler.js:1118:11)
     at Obj.extend._compile (C:\my\nodejs\projects\\node_modules\nunjucks\src\environment.js:414:35)
     at Obj.extend.compile (C:\my\nodejs\projects\\node_modules\nunjucks\src\environment.js:403:18) 
  </code></pre>
  
  <p>Please tell me how to fix this ?</p>