question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

extname configuration property doesn't work

See original GitHub issue

I had some Handlebar templates using .hbs so I used the extname config property to adjust the default, but nothing was rendering… so I renamed my templates to .handlebars and rendering works now.

Issue Analytics

  • State:closed
  • Created 11 years ago
  • Comments:11 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
ericfcommented, Jan 28, 2013

You’ll need to update both the Express’ engine registration, and "view engine" setting to "hbs" as well:

var express = require('express'),
    exphbs = require('express3-handlebars'),

    app = express();

app.engine('hbs', exphbs({extname: '.hbs'}));
app.set('view engine', 'hbs');
1reaction
ericfcommented, Jun 14, 2013

app.set('view engine', 'handlebars');

@uxdiogenes this line is the problem. Express’ "view engine" setting needs to match the extname value that you’re setting when configuring Express Handlebars. Note that the preceding "." is not required, Express is smart enough to work when when dot is missing.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Setup Issue - Phabricator
sudo apt-get install php5-extname # Debian / Ubuntu $ sudo yum install php-extname # Red Hat / Derivatives. If those commands don't work,...
Read more >
Spring @Value doesn't work in nested configuration
I have a application.properties:
Read more >
p4 extension
Firstly, the super user runs p4 extension --configure extName to supply various global details about the Extension's configuration, such as the list of...
Read more >
A Step By Step Guide To Using Handlebars With Your Node js ...
Using this property will give you the control to what name of the file it has to look for in case you didn't...
Read more >
User and Workspace Settings - Visual Studio Code
Settings are written as JSON by specifying the setting ID and value. User settings.json open in the editor. The settings.json file has full...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found