flatiron / viewful

a tiny and isomorphic consolidated view engine for JavaScript

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

undefined error with Hogan.js

kbingman opened this issue · comments

when using hogan.js, the newer versions use the correct "require('hogan')" instead of the previous "require('hogan.js'). This leads to an error when compiling hogan.js templates with viewful and a current copy of hogan.

Thanks for the feedback!

Would you be able to get a pull request open for this?

when I installed hogan using:

npm install hogan

The package.json file shows a version of 1.0.5-dev.

However, when I install Hogan using:

npm install hogan.js

The package file shows a version of 2.0.0

Both of these package files point to the same repository url https://github.com/twitter/hogan.js.git, which is showing version 3.0.0... Not sure where the disconnect is happening, but its weird.

This same issue was filed with Consolidate.js (tj/consolidate.js#54) and was closed without changing anything. Not sure what's going on, maybe Twitter hasn't published the latest release correctly to npm?

@kbingman, are you installing Hogan with npm? And if so, how are you getting the latest version? Are you just grabbing the latest version from github instead of npm?

Looking at Twitter's Hogan site, http://twitter.github.com/hogan.js/, they install and require as follows:

npm install hogan.js

var hogan = require(hogan.js);

@Marak, I'm not sure if I did this correctly... The fix is in a separate branch called "hogan-require-fix". I wanted you to be able to review it before it was merged into master.

@Marak, I didn't realize that referencing the issue in a git commit message closed the issue... Re-opened it so you could review and possibly merge with the master branch. The fix is in a separate branch called "hogan-require-fix". Sorry for the mix-up..

@kbingman, I just merged the fix into the master branch. Sorry for such a long delay. I was waiting for some feedback on whether we wanted to support an unreleased version of hogan.js. The fix has not been published to npm, so you will need to clone the project from github if you want to use it in your project.