Where communities thrive

  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
    anyone know why i get Error: Missing partial with my layout partials
    @shannonmoeller highly appreciate if you could say where the helper is looking. i tried placing my partial in views/partials and also by leaving it in views/layouts
    the issue is that i am using express-handlebars and not sure at what point it loads the partials... arghh!
    Shannon Moeller
    @ankursanghi I have an express test case that might be helpful: https://github.com/shannonmoeller/handlebars-layouts/blob/master/test/express.js
    Thank you Shannon!
    Gevorg Harutyunyan

    @shannonmoeller Thanks for awesome plugins!

    We're using gulp-hb and handlebars-layouts in our build stack. We're working on a open source admin theme.

    And this is our task for processing pages.

    Shannon Moeller
    @madextreme Awesome! Glad you've found it to be useful.
    Hi @shannonmoeller, awesome thing you did with handlebars-layouts. I've read the docs, but I'm a bit confused on how to include this in my backboneJS code. Can you give me a hint ?
    Shannon Moeller
    @andfelzapata Thanks! Super sorry for the late reply. Just saw this. Are you currently using handlebars on your project?
    @shannonmoeller No worries, I am using handlebars.
    Shannon Moeller
    @andfelzapata What build system (if any) are you using?
    Hi guys, i has a problem when using gulp-hb load json data from file. Anybody can help me?
    Here my gulp function: gulp.task('tpl', function () {
    var hbStream = hb()
    icon: "icon.png",
    return gulp
    it doesn't load data :(
    Jan Rembold
    Hi Shannon, maybe we switch to this room. Github issues isn't the right place for a chat :D
    Hi @shannonmoeller , i am getting error when i use handlebars-layout module with consolidate.js , Error: Missing partial: 'layout'
    at Object.extend (C:\Users\Dheeraj Marvel\Desktop\punchtantra\node_modules\handlebars-layouts\index.js:120:11)
    at Object.eval [as main] (eval at createFunctionContext (C:\Users\Dheeraj Marvel\Desktop\punchtantra\node_modules\handlebars\dist\cjs\handlebars\compiler\javascript-compiler.js:254:23), <anonymous>:5:92)
    at main (C:\Users\Dheeraj Marvel\Desktop\punchtantra\node_modules\handlebars\dist\cjs\handlebars\runtime.js:175:32)
    at ret (C:\Users\Dheeraj Marvel\Desktop\punchtantra\node_modules\handlebars\dist\cjs\handlebars\runtime.js:178:12)
    at ret (C:\Users\Dheeraj Marvel\Desktop\punchtantra\node_modules\handlebars\dist\cjs\handlebars\compiler\compiler.js:526:21)
    at C:\Users\Dheeraj Marvel\Desktop\punchtantra\node_modules\consolidate\lib\consolidate.js:735:16
    at C:\Users\Dheeraj Marvel\Desktop\punchtantra\node_modules\consolidate\lib\consolidate.js:144:5
    at Promise._execute (C:\Users\Dheeraj Marvel\Desktop\punchtantra\node_modules\bluebird\js\release\debuggability.js:303:9)
    at Promise._resolveFromExecutor (C:\Users\Dheeraj Marvel\Desktop\punchtantra\node_modules\bluebird\js\release\promise.js:483:18)
    at new Promise (C:\Users\Dheeraj Marvel\Desktop\punchtantra\node_modules\bluebird\js\release\promise.js:79:10)
    at promisify (C:\Users\Dheeraj Marvel\Desktop\punchtantra\node_modules\consolidate\lib\consolidate.js:137:10)
    at Function.exports.handlebars.render (C:\Users\Dheeraj Marvel\Desktop\punchtantra\node_modules\consolidate\lib\consolidate.js:725:10)
    at C:\Users\Dheeraj Marvel\Desktop\punchtantra\node_modules\consolidate\lib\consolidate.js:165:27
    at C:\Users\Dheeraj Marvel\Desktop\punchtantra\node_modules\consolidate\lib\consolidate.js:99:5
    at FSReqWrap.readFileAfterClose [as oncomplete] (fs.js:511:3)

    registraion code i use -
    var handlebarsLayouts = require('handlebars-layouts'),
    handlebars = require('handlebars');

    // handlebars partials
    var partials = path.join(__dirname, 'views/partials');
    var recursive = require('recursive-readdir');
    recursive(partials, function (err, files) {
    files.forEach(function (filename) {
    file = filename.slice(filename.lastIndexOf('/')+1);
    var matches = /^([^.]+).hbs$/.exec(file);
    if (!matches) {return;}
    var name = matches[1];
    var template = filename;
    handlebars.registerPartial(name, read(template));

    ------------------- set up hbs engine ----
    app.engine('hbs', cons.handlebars);
    app.set('views', path.join(__dirname, 'views'));
    app.set('view engine', 'hbs');
    i am unable tp understand where i am doing wrong ,is this issue with your library or consolidate.js ?