shannonmoeller / gulp-hb

A sane Gulp plugin to compile Handlebars templates. Useful as a static site generator.
http://npm.im/gulp-hb
MIT License
147 stars 14 forks source link

Missing helper error #2

Closed pySilver closed 9 years ago

pySilver commented 9 years ago

Example from docs is not working, throwing exception like this one:

Error: Missing helper: 'block'
...

used pipe:

.pipe($.hb({
      data: 'src/data/**/*.{js,json}',
      helpers: [
        './node_modules/handlebars-layouts',
        './node_modules/handlebars-helpers/lib/helpers/helpers-comparisons.js',
        './node_modules/handlebars-helpers/lib/helpers/helpers-collections.js'
      ],
      partials: [
        'src/layouts/**/*.hbs'
      ]
    }))
pySilver commented 9 years ago

turns out that some of assemble.io plugins have "block" dependency which get's overwritten by handlebars-layouts. :(

shannonmoeller commented 9 years ago

This is not an issue with gulp-hb itself. While Assemble-style helpers are supported by gulp-hb, ensuring that the helpers you use don't collide is up to you. In this example, you would not want to use both the handlebars-layouts helper along with the Assemble helpers-layouts.js helper.