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;
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
add a comment |
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
mozilla.github.io/nunjucks/api.html#express ?
– Aikon Mogwai
Mar 25 at 8:59
add a comment |
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
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
node.js express nunjucks
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
add a comment |
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
add a comment |
1 Answer
1
active
oldest
votes
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
It works. But it throwError: 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
add a comment |
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
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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
It works. But it throwError: 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
add a comment |
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
It works. But it throwError: 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
add a comment |
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
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
answered Mar 26 at 12:44
Ahmed AyoubAhmed Ayoub
17117
17117
It works. But it throwError: 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
add a comment |
It works. But it throwError: 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
add a comment |
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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
mozilla.github.io/nunjucks/api.html#express ?
– Aikon Mogwai
Mar 25 at 8:59