Everything works as expected until I try and introduce header.hbs as a partial.
I have also tried this
Following further investigation I have also tried this:
// Create `ExpressHandlebars` instance with a default layout.
var hbs = exphbs.create({
// Uses multiple partials dirs, templates in "shared/templates/" are shared
// with the client-side of the app (see below).
partialsDir: [
'views/partials/'
]
});
// Register `hbs` as our view engine using its bound `engine()` function.
app.engine('hbs', hbs.engine);
app.set('view engine', 'hbs');
I am trying to use this library
express-handlebars
and make use ofpartials
but I am getting the following error messageMy
app.js
code looks like as follows.This is all working and the express app is running on localhost:3000.
My folder structure is as follows:
main.hbs
header.hbs
home.hbs
Everything works as expected until I try and introduce
header.hbs
as a partial.I have also tried this
Following further investigation I have also tried this: