Comments (9)
Just experienced the same thing on a new project.
node 0.10.7
grunt 0.4.1
grunt-contrib-handlebars 0.5.9
handlebars 1.0.0-rc.4 (via Bower)
UPDATE: I tried grabbing the latest handlebars (1.0.0) from the website and it worked.
After a little digging, it looks like the problem is caused by Handlebars 1.0.12. When I set the version to 1.0.11, it works. So the issue (sort of) is this package's reliance on "handlebars": "~1.0.10"
, which pulls down 1.0.12. Ultimately, this seems like a Handlebars issue though, not really something wrong with this package.
UPDATE 2: According to this issue, 1.0.0 is required to use the 1.0.12 build.
from grunt-contrib-handlebars.
We had the same issue. We pulled the runtime from the handlebars site and it was working again.
from grunt-contrib-handlebars.
Hi!
We were experiencing the same.
Via npm shrinkwrap we were able to force grunt-contrib-handlebars to use handlebars 1.0.10 instead of 1.0.12.
from grunt-contrib-handlebars.
Hi, same thing happend to us, we fixed it using @KK-MarcelJahn solution.
from grunt-contrib-handlebars.
The 1.0.0 runtime is required to use pre-compiled templates with built with 1.0.12. If you're having issues, update your client side version.
from grunt-contrib-handlebars.
@w33ble Updating the client-side when you output as an npm module for, say, browserify, makes absolutely no difference whatsoever. The require statement in the output templates.js file still says require('handlebars'); when options: node === true.
I can confirm that this issue is not fixed.
For reference, here is my handlebars grunt config:
handlebars: main: options: wrapped: true namespace: 'com.banno.clientlib.templates' node: true processName: (filename) -> filenameRegex = ///(?:.*/)*(.*)(?:\.handlebars$)/// filenameRegex.exec(filename)[1] files: [ src: [ 'src/main/handlebars/*.handlebars' 'src/main/handlebars/**/*.handlebars' 'src/main/handlebars/**/**/*.handlebars' 'src/main/handlebars/**/**/**/*.handlebars' ] dest: 'dist/templates.js' ]
I use browserify to build my applications. It walks the require tree and creates a nice wrapped environment for you so that your application can be completely modular in the browser without using an external loader.
So when require is called, the version of handlebars included in the grunt-contrib-handlebars package matters. I attempted to fix this by using [email protected] However, there is still a problem, because grunt-contrib-handlebars isn't including the modular handlebars runtime. Any help is appreciated.
from grunt-contrib-handlebars.
I haven't used browserify before, so I don't know what the issue would be. I suspect that it's not a problem with the grunt plugin, but I could be wrong. According to the issue that was opened in handlebars (see above), they only test things against the packaged versions. In this case, 1.0.12 and 1.0.0 (final). If you mix a match, things will probably break, as they did here.
Maybe opening an issue in the handlebars repo would shed some light on your issue?
from grunt-contrib-handlebars.
The issue is in the handlebars bower component repo. It's still referenccing old dependency versions. Sent a pull request to fix it.
from grunt-contrib-handlebars.
@w33ble – Updating the runtime to 1.0.0 did the trick. Thanks!
from grunt-contrib-handlebars.
Related Issues (20)
- Precompiled JST in <=IE9 HOT 2
- Partial's context is undefined
- Add support for Handlebars 3.x HOT 17
- Allow to specify Handlebars version HOT 1
- Add UMD support HOT 2
- How to add Custom Helpers HOT 2
- AMD requires 'handlebars' instead of just 'handlebars.runtime' HOT 1
- How to add runtime code to output file?
- handlebars with grunt HOT 1
- Update to Handlebars 4.*, precompiled templates not usable with latest bower version HOT 20
- Using commonjs:true generates incorrect JS code (0.10.2) HOT 2
- Declaring multiple AMD dependencies with a function
- 0.11? HOT 2
- Is "style" a keyword of grunt-contrib-handlebars
- options.separator gets normalized HOT 1
- Tests aren't passing with the current master branch HOT 1
- Can be this used from a file watcher?
- Still Maintained?
- Arbitrary Code Execution
- Does not return Template when Pre-Processing as a partial using AMD
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.