Error: No default engine was specified and no extension was provided (ExpressJs & nunjucks)Error: No default engine was specified and no extension was providedError: No default engine was specified and no extension was provided. at new View — node-push serverHow to set marko template engine in expressjs 4.0Unable to load css fileExpressJS + Express-mailer No default enginejsonwebtoken error No default engine was specified and no extension was providedExpress - Error: No default engine was specified and no extension was providedNode Express RESTful API default engine for error handlingReact - express: No default engine was specified and no extension was provided

Aligning object in a commutative diagram

What can plausibly explain many of my very long and low-tech bridges?

Through what methods and mechanisms can a multi-material FDM printer operate?

Is there any word or phrase for negative bearing?

Completing the square to find if quadratic form is positive definite.

How can drunken, homicidal elves successfully conduct a wild hunt?

How is it possible that Gollum speaks Westron?

You've spoiled/damaged the card

Secure offsite backup, even in the case of hacker root access

Importance sampling estimation of power function

What is in `tex.print` or `tex.sprint`?

Did thousands of women die every year due to illegal abortions before Roe v. Wade?

Whats the next step after commercial fusion reactors?

From system of coupled ODEs to separable ODE

Finding x,y coordinates where y is largest

Can a 2nd-level sorcerer use sorcery points to create a 2nd-level spell slot?

PC video game involving floating islands doing aerial combat

Is it legal in the UK for politicians to lie to the public for political gain?

What happens to foam insulation board after you pour concrete slab?

Can a magnetic field of an object be stronger than its gravity?

Will TSA allow me to carry a Continuous Positive Airway Pressure (CPAP)/sleep apnea device?

How to supress loops in a digraph?

How bad would a partial hash leak be, realistically?

Do any instruments not produce overtones?



Error: No default engine was specified and no extension was provided (ExpressJs & nunjucks)


Error: No default engine was specified and no extension was providedError: No default engine was specified and no extension was provided. at new View — node-push serverHow to set marko template engine in expressjs 4.0Unable to load css fileExpressJS + Express-mailer No default enginejsonwebtoken error No default engine was specified and no extension was providedExpress - Error: No default engine was specified and no extension was providedNode Express RESTful API default engine for error handlingReact - express: No default engine was specified and no extension was provided






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








1















I am trying to use nunjucks templating engine with Expres js. The page is rendered correctly but error appears on console.
Error: No default engine was specified and no extension was provided.



from nunjucks docs



var app = express();

nunjucks.configure('views',
autoescape: true,
express: app
);

app.get('/', function(req, res)
res.render('index.html');
);


I traced the error and found it comes form at new NunjucksView (C:UsersfutureDesktopNew folder (2)node_modulesnunjuckssrcexpress-app.js:13:13)



In nodemodules/nunjucks/src/express-app.js throw error



 if (!this.ext && !this.defaultEngine) 
throw new Error('No default engine was specified and no extension was provided.');



Which means as I understand that defaultEngine is not set.



Github Repo




How to set default template engine while using nunjucks.










share|improve this question
























  • mozilla.github.io/nunjucks/api.html#express ?

    – Aikon Mogwai
    Mar 25 at 8:59

















1















I am trying to use nunjucks templating engine with Expres js. The page is rendered correctly but error appears on console.
Error: No default engine was specified and no extension was provided.



from nunjucks docs



var app = express();

nunjucks.configure('views',
autoescape: true,
express: app
);

app.get('/', function(req, res)
res.render('index.html');
);


I traced the error and found it comes form at new NunjucksView (C:UsersfutureDesktopNew folder (2)node_modulesnunjuckssrcexpress-app.js:13:13)



In nodemodules/nunjucks/src/express-app.js throw error



 if (!this.ext && !this.defaultEngine) 
throw new Error('No default engine was specified and no extension was provided.');



Which means as I understand that defaultEngine is not set.



Github Repo




How to set default template engine while using nunjucks.










share|improve this question
























  • mozilla.github.io/nunjucks/api.html#express ?

    – Aikon Mogwai
    Mar 25 at 8:59













1












1








1








I am trying to use nunjucks templating engine with Expres js. The page is rendered correctly but error appears on console.
Error: No default engine was specified and no extension was provided.



from nunjucks docs



var app = express();

nunjucks.configure('views',
autoescape: true,
express: app
);

app.get('/', function(req, res)
res.render('index.html');
);


I traced the error and found it comes form at new NunjucksView (C:UsersfutureDesktopNew folder (2)node_modulesnunjuckssrcexpress-app.js:13:13)



In nodemodules/nunjucks/src/express-app.js throw error



 if (!this.ext && !this.defaultEngine) 
throw new Error('No default engine was specified and no extension was provided.');



Which means as I understand that defaultEngine is not set.



Github Repo




How to set default template engine while using nunjucks.










share|improve this question
















I am trying to use nunjucks templating engine with Expres js. The page is rendered correctly but error appears on console.
Error: No default engine was specified and no extension was provided.



from nunjucks docs



var app = express();

nunjucks.configure('views',
autoescape: true,
express: app
);

app.get('/', function(req, res)
res.render('index.html');
);


I traced the error and found it comes form at new NunjucksView (C:UsersfutureDesktopNew folder (2)node_modulesnunjuckssrcexpress-app.js:13:13)



In nodemodules/nunjucks/src/express-app.js throw error



 if (!this.ext && !this.defaultEngine) 
throw new Error('No default engine was specified and no extension was provided.');



Which means as I understand that defaultEngine is not set.



Github Repo




How to set default template engine while using nunjucks.







node.js express nunjucks






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 24 at 18:29







Elhaw

















asked Mar 24 at 14:42









ElhawElhaw

9012




9012












  • mozilla.github.io/nunjucks/api.html#express ?

    – Aikon Mogwai
    Mar 25 at 8:59

















  • mozilla.github.io/nunjucks/api.html#express ?

    – Aikon Mogwai
    Mar 25 at 8:59
















mozilla.github.io/nunjucks/api.html#express ?

– Aikon Mogwai
Mar 25 at 8:59





mozilla.github.io/nunjucks/api.html#express ?

– Aikon Mogwai
Mar 25 at 8:59












1 Answer
1






active

oldest

votes


















1














You should set the default view engine for express to be the same extension known/rendered by nunjucks



const express = require('express');
const nunjucks = require('nunjucks');

const app = express();

// set default express engine and extension
app.engine('html', nunjucks.render);
app.set('view engine', 'html');

// configure nunjucks engine
nunjucks.configure('views',
autoescape: true,
express: app
);

app.get('/', function(req, res)
res.render('index');
);

app.listen(9090, () =>
console.log('http://localhost:9090')
);


if you want to change templates/views extension, you can change it like that:



app.engine('nunj', nunjucks.render);
app.set('view engine', 'nunj');


and then rename your templates/views index.nunj






share|improve this answer























  • It works. But it throw Error: template not found: error.html. I added error.html file in view directory and error is fixed.@Ahmed Ayoub I did not try changing templates/views extension.

    – Elhaw
    Mar 26 at 13:48












Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55324940%2ferror-no-default-engine-was-specified-and-no-extension-was-provided-expressjs%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









1














You should set the default view engine for express to be the same extension known/rendered by nunjucks



const express = require('express');
const nunjucks = require('nunjucks');

const app = express();

// set default express engine and extension
app.engine('html', nunjucks.render);
app.set('view engine', 'html');

// configure nunjucks engine
nunjucks.configure('views',
autoescape: true,
express: app
);

app.get('/', function(req, res)
res.render('index');
);

app.listen(9090, () =>
console.log('http://localhost:9090')
);


if you want to change templates/views extension, you can change it like that:



app.engine('nunj', nunjucks.render);
app.set('view engine', 'nunj');


and then rename your templates/views index.nunj






share|improve this answer























  • It works. But it throw Error: template not found: error.html. I added error.html file in view directory and error is fixed.@Ahmed Ayoub I did not try changing templates/views extension.

    – Elhaw
    Mar 26 at 13:48
















1














You should set the default view engine for express to be the same extension known/rendered by nunjucks



const express = require('express');
const nunjucks = require('nunjucks');

const app = express();

// set default express engine and extension
app.engine('html', nunjucks.render);
app.set('view engine', 'html');

// configure nunjucks engine
nunjucks.configure('views',
autoescape: true,
express: app
);

app.get('/', function(req, res)
res.render('index');
);

app.listen(9090, () =>
console.log('http://localhost:9090')
);


if you want to change templates/views extension, you can change it like that:



app.engine('nunj', nunjucks.render);
app.set('view engine', 'nunj');


and then rename your templates/views index.nunj






share|improve this answer























  • It works. But it throw Error: template not found: error.html. I added error.html file in view directory and error is fixed.@Ahmed Ayoub I did not try changing templates/views extension.

    – Elhaw
    Mar 26 at 13:48














1












1








1







You should set the default view engine for express to be the same extension known/rendered by nunjucks



const express = require('express');
const nunjucks = require('nunjucks');

const app = express();

// set default express engine and extension
app.engine('html', nunjucks.render);
app.set('view engine', 'html');

// configure nunjucks engine
nunjucks.configure('views',
autoescape: true,
express: app
);

app.get('/', function(req, res)
res.render('index');
);

app.listen(9090, () =>
console.log('http://localhost:9090')
);


if you want to change templates/views extension, you can change it like that:



app.engine('nunj', nunjucks.render);
app.set('view engine', 'nunj');


and then rename your templates/views index.nunj






share|improve this answer













You should set the default view engine for express to be the same extension known/rendered by nunjucks



const express = require('express');
const nunjucks = require('nunjucks');

const app = express();

// set default express engine and extension
app.engine('html', nunjucks.render);
app.set('view engine', 'html');

// configure nunjucks engine
nunjucks.configure('views',
autoescape: true,
express: app
);

app.get('/', function(req, res)
res.render('index');
);

app.listen(9090, () =>
console.log('http://localhost:9090')
);


if you want to change templates/views extension, you can change it like that:



app.engine('nunj', nunjucks.render);
app.set('view engine', 'nunj');


and then rename your templates/views index.nunj







share|improve this answer












share|improve this answer



share|improve this answer










answered Mar 26 at 12:44









Ahmed AyoubAhmed Ayoub

17117




17117












  • It works. But it throw Error: template not found: error.html. I added error.html file in view directory and error is fixed.@Ahmed Ayoub I did not try changing templates/views extension.

    – Elhaw
    Mar 26 at 13:48


















  • It works. But it throw Error: template not found: error.html. I added error.html file in view directory and error is fixed.@Ahmed Ayoub I did not try changing templates/views extension.

    – Elhaw
    Mar 26 at 13:48

















It works. But it throw Error: template not found: error.html. I added error.html file in view directory and error is fixed.@Ahmed Ayoub I did not try changing templates/views extension.

– Elhaw
Mar 26 at 13:48






It works. But it throw Error: template not found: error.html. I added error.html file in view directory and error is fixed.@Ahmed Ayoub I did not try changing templates/views extension.

– Elhaw
Mar 26 at 13:48




















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55324940%2ferror-no-default-engine-was-specified-and-no-extension-was-provided-expressjs%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

SQL error code 1064 with creating Laravel foreign keysForeign key constraints: When to use ON UPDATE and ON DELETEDropping column with foreign key Laravel error: General error: 1025 Error on renameLaravel SQL Can't create tableLaravel Migration foreign key errorLaravel php artisan migrate:refresh giving a syntax errorSQLSTATE[42S01]: Base table or view already exists or Base table or view already exists: 1050 Tableerror in migrating laravel file to xampp serverSyntax error or access violation: 1064:syntax to use near 'unsigned not null, modelName varchar(191) not null, title varchar(191) not nLaravel cannot create new table field in mysqlLaravel 5.7:Last migration creates table but is not registered in the migration table

은진 송씨 목차 역사 본관 분파 인물 조선 왕실과의 인척 관계 집성촌 항렬자 인구 같이 보기 각주 둘러보기 메뉴은진 송씨세종실록 149권, 지리지 충청도 공주목 은진현