Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error: handlebars does not support render #31

Closed
jonschlinkert opened this issue Nov 22, 2015 · 28 comments
Closed

error: handlebars does not support render #31

jonschlinkert opened this issue Nov 22, 2015 · 28 comments

Comments

@jonschlinkert
Copy link
Member

If you're experiencing this issue. please add information about your build to this issue (please, don't create another issue)

@jonschlinkert
Copy link
Member Author

related assemble/assemble.io#158

@jonschlinkert
Copy link
Member Author

@eurolife are you using something like load-grunt-tasks or match-dep?

@eurolife
Copy link

Please bear with me, as I am quite new to this, but in my grunt file, there is grunt.registerTask and after that grunt.task.run which runs the specified tasks. There is also grunt.initConfig which defines all the tasks beforehand. Does that help or are you looking for something else?

@jonschlinkert
Copy link
Member Author

It's okay, I remember going through the same thing like it was yesterday lol. There is a lot to take in...

Does that help or are you looking for something else?

Could you add your entire gruntfile to a gist? https://gist.github.com/. If so that would be great, then just link it back here. If not, that's ok we can try to step through it

@eurolife
Copy link

Here is a link to it https://gist.github.com/eurolife/8062a7170e9efe937798
Really appreciate you helping me with this!

@jonschlinkert
Copy link
Member Author

Hmm, nothings jumps out at me.

just thinking out loud so we can try to narrow the problem down:

i'll keep looking too

@jonschlinkert
Copy link
Member Author

oh, I almost missed this. You mentioned that you're using assemble 0.4.x, correct? please try updating to grunt-assemble and see if that helps. make sure you:

  • completely delete node_modules in your project
  • remove assemble from package.json deps or devDeps
  • then do npm install grunt-assemble --save-dev

let me know if that helps

@eurolife
Copy link

Ok, I did what you said - I removed node_modules and also removed assemble from package.json and then installed grunt-assemble. After that I also had to do npm install otherwise grunt serve would not run. Unfortunately, I am still getting that same error after doing all of that.

@eurolife
Copy link

fyi i did try running assemble by itself and got the same error.

@jonschlinkert
Copy link
Member Author

do you have any custom helpers? or are there any helpers that are included by the generator?

@doowb
Copy link
Member

doowb commented Nov 22, 2015

@eurolife can you link to an entire repository or at least create a gist with the package.json? Also, will you post information your environment like OS, node and npm versions?

@eurolife
Copy link

Do you mean helpers in handlebars? I didn't add any and don't know if the
generator did. If there is a place i should look for that, let me know.
On Nov 22, 2015 20:36, "Jon Schlinkert" notifications@github.com wrote:

do you have any custom helpers? or are there any helpers that are included
by the generator?


Reply to this email directly or view it on GitHub
#31 (comment)
.

@eurolife
Copy link

I'm out the door now but will put my project up on github later and will
let you know. Thanks.
On Nov 22, 2015 20:45, "Brian Woodward" notifications@github.com wrote:

@eurolife https://github.com/eurolife can you link to an entire
repository or at least create a gist with the package.json? Also, will you
post information your environment like OS, node and npm versions?


Reply to this email directly or view it on GitHub
#31 (comment)
.

@doowb
Copy link
Member

doowb commented Nov 22, 2015

I just figured it out. yo-webapp doesn't add a version to the package.json.

In grunt-assemble, we're using assemble-handlebars by default, which uses handlebars-helpers.
In the version of handlebars-helpers that's being used, we're using to for YAML formatting, which is using handy and trying to get the package.json version.

Since grunt-assemble attempts to first load assemble-handlebars then falls back to handlebars if it fails to load, handlebars is trying to be used as the engine directly, which doesn't have a .render method.

It works if you add a version property to your package.json file.

In later newer versions of assemble and handlebars-helpers we're doing things differently so this type of error won't happen.

@jonschlinkert
Copy link
Member Author

In later newer versions of assemble and handlebars-helpers we're doing things differently so this type of error won't happen.

indeed. great debugging @doowb!

@jonschlinkert
Copy link
Member Author

btw, should this be reported as a bug to handy, or to or somewhere else?

@doowb
Copy link
Member

doowb commented Nov 23, 2015

Looks like @johnyb already tracked this down: helpers/handlebars-helpers#199

He's opened issues on both handy and to.

@johnyb
Copy link

johnyb commented Nov 23, 2015

Unfortunately, both projects seem to be dead. 💀 :\

At the moment, I'm working around this using an npm-shrinkwrap.json file and artificially place the dependencies in a way, everything works as before npm@3.

@jonschlinkert
Copy link
Member Author

that's right I remember now, thanks @johnyb. seems like we should be able to do patches to fix this.

@eurolife
Copy link

That worked! Thank you so much!

@yan-kisen
Copy link

I encountered this issue by appending -SNAPSHOT to the version in my package.json

Changing "version":"1.0.0-SNAPSHOT" to "version":"1.0.0" fixed the build, without needing to change any other dependencies.

Not sure if it's the same for every instance of this error, but hopefully someone else can save some time.

For reference, here are my dependencies which are working:

"devDependencies": {
    "assemble-partial-data": "^0.1.0",
    "fs-extra": "^0.30.0",
    "generator-helper": "^0.2.0",
    "grunt": "^0.4.5",
    "grunt-assemble": "^0.4.0",
    "grunt-autoprefixer": "~3.0.3",
    "grunt-bump": "0.0.15",
    "grunt-changelog": "^0.2.2",
    "grunt-cli": "~0.1.13",
    "grunt-contrib-clean": "^0.7.0",
    "grunt-contrib-concat": "^0.5.1",
    "grunt-contrib-connect": "^0.11.2",
    "grunt-contrib-copy": "^0.8.2",
    "grunt-contrib-cssmin": "^0.14.0",
    "grunt-contrib-htmlmin": "^0.3.0",
    "grunt-contrib-less": "^1.1.0",
    "grunt-contrib-uglify": "^0.11.0",
    "grunt-contrib-watch": "^0.6.1",
    "grunt-filerev": "^2.3.1",
    "grunt-merge-copy": "^1.0.1",
    "grunt-notify": "^0.4.2",
    "grunt-stripcomments": "^0.5.0",
    "load-grunt-config": "^0.19.1",
    "load-grunt-tasks": "^3.4.0",
    "time-grunt": "^1.3.0"
  }`

@LaurentGoderre
Copy link
Contributor

@yan-kisen YOU ARE RIGHT! It's not an option for us to change this but maybe I can look at a fix for this

/cc @masterbee

@garethjmsaunders
Copy link

garethjmsaunders commented Jan 8, 2017

We've just encountered this error now. Our project, including the gruntfile is here: https://github.com/standrewsdigital/digital-pattern-library

Similar to yan-kisen, above, we get the error "Warning: handlebars does not support render." if we append a pre-release tag on the end of the version number.

The package.json documentation says "Version must be parseable by node-semver, which is bundled with npm as a dependency. "

If our version number is "version": "0.9.0" then the build works, but if I add a pre-release tag, e.g. "version": "0.9.0-alpha.1" then the build fails.

Our devDependencies list:

"devDependencies": {
"grunt": "~1.0.0",
"grunt-assemble": "~0.5.0",
"grunt-contrib-clean": "~1.0.0",
"grunt-contrib-compass": "~1.1.0",
"grunt-contrib-concat": "~1.0.0",
"grunt-contrib-copy": "~1.0.0",
"grunt-contrib-jshint": "~1.0.0",
"grunt-contrib-uglify": "~2.0.0",
"grunt-contrib-watch": "~1.0.0",
"grunt-gitinfo": "~0.1.0",
"handlebars-helper-asset": "git://github.com/sjparsons/handlebars-helper-asset.git#relative-links",
"handlebars-helper-rel": "git://github.com/sjparsons/handlebars-helper-rel.git#fix",
"handlebars-helpers": "~0.7.0",
"swag": "~0.7.0"
},

UPDATE: I have resolved this by navigating to node_modules/assemble-handlebars and running npm install in that directory. A number of modules were installed, and everything works as expected now.

@NNemec
Copy link

NNemec commented Feb 17, 2017

I had the same problem. Turns out, the top-level project did not have any "version" field in the package.json file. Adding this field fixes the issue. Is is not sufficient for the field to exist, but it has actually contain a proper semver value.

The specs for package.json actually request this field and the correct formatting, so the best fix for this issue would be to add a check in grunt-assemble and improve the error message.

Thanks to garethjmsaunders for your hint!

@cubodehelio
Copy link

I had the same problem. It seems that the cause was that I put a version like the following in my package.json:

{
  "version": "1.0.0-rc.1",
}

When i changed to 1.0.0 the problem disappeared.

@LaurentGoderre
Copy link
Contributor

@jonschlinkert @doowb I was able to create a fix for this by extarcting the single method used in the to package but then realized that you don't even use the package in the latest version. However there seem to be an issue that this project doesn't install handlebars-helpers past 0.5.8. Any idea why that is?

@elpeq
Copy link

elpeq commented May 4, 2017

Thanks @yan-kisen, removing -SNAPSHOT in the version fixed my problem :-)

@LaurentGoderre
Copy link
Contributor

LaurentGoderre commented May 4, 2017

@elpeq if you update to the latest version, you don't need to remove your -snapshot anymore.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants