ericf / express-handlebars

A Handlebars view engine for Express which doesn't suck.
BSD 3-Clause "New" or "Revised" License
2.31k stars 383 forks source link

View renders blank when no layout #73

Closed knownasilya closed 10 years ago

knownasilya commented 10 years ago

Here's my config (I'm using express4):

app.set('views', path.join(__dirname, '..', 'dist'));
app.set('view engine', 'html');
app.engine('html', handlebars({
  extname: '.html'
}));

See runnable (broken). Workaround
There are no errors, just a blank html page and the DOM looks generic. Previously when I ran it with incorrect paths or extensions I got errors.

Looks like if there is no layout (even { layout: false }) then you don't return anything here.

ericf commented 10 years ago

Yeah, this is a bug. I need to return body when there's no layout.

ericf commented 10 years ago

I published v1.0.1 which fixes this. Thanks for reporting it!

knownasilya commented 10 years ago

@ericf thanks for the quick fix!