Failed to lookup view in directory with Express Handlebars
Creating error.hbs file in views directory solved my issue.
var exphbs = require('express-handlebars');
// view engine setup
app.engine('hbs', exphbs({ defaultLayout: 'main', extname: '.hbs' }));
app.set('views', path.join(__dirname, 'views'));
app.set('view engine', 'hbs');
Somewhat counter-intuitively, setting the extension name is not enough.
The required setup is:
app.engine('hbs', exphbs({defaultLayout: 'main', extname: '.hbs'}));
app.set('view engine', 'hbs');