Questions tagged [express-handlebars]
474 questions
27
votes
8 answers
TypeError: exphbs is not a function
I am trying to use the express-handlebars module but have an error.
My code:
var exphbs = require('express-handlebars');
app.engine('.hbs', exphbs({ extname: '.hbs', defaultLayout: "main"}));
app.set('view engine', '.hbs');
My…

Adidi24
- 271
- 1
- 3
- 4
11
votes
1 answer
MIME type ('text/html') is not a supported stylesheet
I'm linking a css file to my express-handlebars file but I am getting this error:
Refused to apply style from 'http://localhost:4000/cs366/style/draft.css' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME…

ajjohnson190
- 494
- 2
- 7
- 21
8
votes
1 answer
How to use handlebars with nodemailer to send email?
I am using nodemailer to send emails using the following nodemailer-express-handlebars plugin. I used this {dead blog post} as reference
The code is compiling the welcome template but is not using the layout
My code is as below:
var nodemailer =…

Masade
- 715
- 1
- 11
- 29
7
votes
11 answers
Error: ENOENT: no such file or directory in express-handlebars
I am using express-handlebars to load dynamic content in NodeJS
inside app.js
const express = require("express");
const bodyParser = require("body-parser");
const path = require("path");
const pp = require("./util/path.js");
const adminRoutes =…

Abdulrahman Falyoun
- 3,676
- 3
- 16
- 43
6
votes
6 answers
Express Handlebars Won't Render Data
I am working with NodeJS and Express using Express-Handlebars template engine.
Handlebars is throwing the following error when trying to render a template:
Handlebars: Access has been denied to resolve the property "username"
because it is not…

CoatCat
- 162
- 1
- 9
5
votes
3 answers
nodemailer-express-handlebars | Error: ENOENT: no such file or directory for template
I am having an issue where nodemailer-express-handlebars is outputing the error:
[Error: ENOENT: no such file or directory, open ''] {
errno: -2,
code: 'ENOENT',
syscall: 'open',
path:…

emarel
- 371
- 7
- 30
5
votes
4 answers
express-handlebars cant find dir or file
okey so im trying to get handlebars to workand so ive been following this youtube guide: https://www.youtube.com/watch?v=SfQFoMOd_ng
and my problem is that the code on row 15 gets an error:
Error: ENOENT: no such file or directory, open…

maxilaxen
- 55
- 1
- 3
5
votes
2 answers
express handlebars render to string instead of response
I currently use express handlebars successfully - however I want to use it for updating and rendering only a piece of a page - a list of items that changes over time, so I want to update just that list on a timer. Essentially on the browser I have…

Darren Oakey
- 2,894
- 3
- 29
- 55
4
votes
1 answer
webpack with express-handlebars
I'm trying to migrate an old express site to webpack, but don't wanna rework all the layout tempaltes which use express-handlebars. Is it possible to use express-handlebars with webpack?
handlebars-loader seems not to support the layout concept of…

catlan
- 25,100
- 8
- 67
- 78
4
votes
1 answer
Express-handlebars route parameters to link to the same page
I have an SPA made with express-handlebars.
I need to pass route parameters in the URL so I can pick it up in the subsequent page it leads to and render the details pertaining to that parameter.
for eg.
www.sitename.com/events/1 ,…

Scary Terry
- 217
- 3
- 14
4
votes
2 answers
handlebars i18n helper inside each loop
I am using express handlebars to generate my view but I am having a problem which is that some of the content inside of my view is not translated properly because I am calling the I18n helper inside of an #each helper.
Index.handlebars :
{{#if…

toh19
- 1,083
- 10
- 21
3
votes
1 answer
What visual studio code formatter can i use to format .hbs handlebars files?
I am working on a Node.js project that has Handlebars .hbs files in it. I am unable to format the .hbs files, because the standard version of the Prettier extension for VS Code doesn't support the .hbs file-type, or the Handlebars syntax.
What…

Bukoye
- 61
- 1
- 8
3
votes
2 answers
exphbs is not a function
I have been trying to test out express and express handlebars. I have read and tried a few demos. They all basically the same but I cannot get any of them to work. The error I keep getting is -
app.engine('handlebars', exphbs());
^
TypeError:…

jimmy emanon
- 33
- 4
3
votes
2 answers
Cannot connect frontend and backend in Express, Node and Javascript
Thank you for taking time to read my question. Currently I am working on using a dropdown list using "select" tag for the user to select from. and totally stuck on the following. localhost, all other pages and functions working properly . yet…

VOSH
- 123
- 9
3
votes
1 answer
Uploading a file with express-fileupload doesn't work
I'm attempting to upload a file with express-fileupload (express-fileupload) in Node js.
But I wasn't successfully yet.
My app.js (where my express server is running) looks like this:
const express = require('express');
const exphbs =…

Lukas Keller
- 51
- 1
- 6