assemble / assemble-handlebars

Assemble engine plugin for Handlebars templates
https://github.com/assemble/assemble
MIT License
8 stars 19 forks source link

Can't pass hash of named parameters in v2.5 or 3.0 #29

Closed IRun26Point2 closed 9 years ago

IRun26Point2 commented 9 years ago

The construct: {{> carousel-8 onestore=../onestore}}

worked fine in 0.2.4, and seems to have regressed in 0.2.5 and 0.3.0 reporting an error at the = character, saying Parse Error. Expecting 'CLOSE', 'CLOSE_UNESCAPED'......

According to @wycats, this can be tested via this case and this case as well.

doowb commented 9 years ago

How are you using this library because 0.2.5 and 0.3.0 are both using Handlebars 3.0.1 which is the same version in 0.2.4.

IRun26Point2 commented 9 years ago

wow - thanks for the quick response!
I'm doing this via grunt. to verify repro: I did npm cache clean deleted my local project's node_modules folder npm install assemble continues to fail with a parse error for the equals sign.

here's my dev dependencies:

"devDependencies": {
    "assemble": "^0.4.42",
    "grunt": "^0.4.5",
    "grunt-contrib-clean": "^0.6.0",
    "grunt-contrib-connect": "^0.9.0",
    "grunt-contrib-watch": "^0.6.1",
    "grunt-nuget": "^0.1.4",
    "grunt-sass": "^0.18.0",
    "grunt-webfont": "^0.5.1"
  }

and the relevant npm list results: ├─┬ assemble@0.4.42 │ ├─┬ assemble-handlebars@0.2.6 │ │ ├─┬ handlebars@1.3.0 │ │ │ ├─┬ optimist@0.3.7 │ │ │ │ └── wordwrap@0.0.3 │ │ │ └─┬ uglify-js@2.3.6 │ │ │ ├── async@0.2.10 │ │ │ └─┬ source-map@0.1.43 │ │ │ └── amdefine@0.1.0 │ │ └─┬ handlebars-helpers@0.5.8

Then I go to my node_modules/assemble/node_modules folder and remove assemble-handlebars, and then install@0.2.4,

assemble-handlebars@0.2.4 assemble-handlebars ├── handlebars@3.0.3 (optimist@0.6.1, source-map@0.1.43, uglify-js@2.3.6) └── handlebars-helpers@0.5.8 (sort-object@0.0.5, marked@0.2.10, minimatch@0.2.14 , highlight.js@7.4.0, to@0.2.9, iconv-lite@0.2.11, lodash@2.2.1, matchdep@0.3.0, js-yaml@2.1.3, matchkeys@0.1.3, handlebars@1.3.0, nap@0.7.21)

Then I went back to my project folder and everything works.

Please let me know if there's any other diagnostic info...

doowb commented 9 years ago

We should have done all this before updating to handlebars@3.0.0, but the assemble-handlebars@0.2.6 change was to revert it back to handlebars@1.3.0.

Try using grunt-assemble@0.3.0 (latest). Since you're using assemble@0.4.42, you'll need to update your dependency in your package.json and your Gruntfile.js to include grunt-assemble instead of assemble. Everything else is the same, sorry for the confusion.

doowb commented 9 years ago

btw... I just confirmed with a fresh install of grunt-assemble@0.3.0 this works fine.

IRun26Point2 commented 9 years ago

You and @jonschlinkert rock! Thanks. I'm completely unblocked. I switched over to grunt-assemble@3.0.0, and everything works like a champ. Keep up the awesome work you're doing with assemble, we use it all the time!

doowb commented 9 years ago

:+1: