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

Minified lib returns an empty string #1129

Closed
bricss opened this issue Nov 12, 2015 · 8 comments
Closed

Minified lib returns an empty string #1129

bricss opened this issue Nov 12, 2015 · 8 comments

Comments

@bricss
Copy link

bricss commented Nov 12, 2015

Hi there,

I have found that latest version of minified handlebars.min.js surprisingly returns an empty string every time on each compile operation.

For example:

var tpl = Handlebars.compile('{{foo}}');
var output = tpl({foo: 'bar'});
console.log(output === ''); // true
@kpdecker
Copy link
Collaborator

This is unexpected. Could you create a fiddle demonstrating the issue? A
template is provided in the contributing.md document. Also what
environments are you seeing this issue in?
On Thu, Nov 12, 2015 at 4:23 PM Yehor Sergeenko [email protected]
wrote:

Hi there,

I have found that latest version of minified handlebars.min.js
http://builds.handlebarsjs.com.s3.amazonaws.com/handlebars.min-v4.0.4.js
surprisingly returns an empty string every time on each compile operation.

For example:

var tpl = Handlebars.compile('{{foo}}');var output = tpl({foo: 'bar'});console.log(output) === '' // true


Reply to this email directly or view it on GitHub
#1129.

@bricss
Copy link
Author

bricss commented Nov 13, 2015

I found that problem when start preparing production version of our web app. We are using handlebars to render course quizzes to our users. And when we have updated to latest version quizzes stop to appear in html courses. After half an hour of debugging I found where was a problem when changed minified file to ordinary.

Later today I will add example.

@kpdecker
Copy link
Collaborator

By environment, I mean what browser or other javascript engine.

@bricss
Copy link
Author

bricss commented Nov 13, 2015

Every, chrome 46, firefox 42, ie10-11-edge, opera 33, safari 9 and ios webview.

@bricss
Copy link
Author

bricss commented Nov 13, 2015

Proof of concept -> http://jsfiddle.net/pmtytqoa/1/

@kpdecker
Copy link
Collaborator

Not sure what went wrong but I was able to write some tests that reproduce this failure. It appears to be specific to the full library when minimized. The runtime library works properly, at least when run in the node test environment.

@kpdecker
Copy link
Collaborator

This is somehow caused by gruntjs/grunt-contrib-uglify#366. Leaving the comments in place caused something to break after minimization in a way that is not clear to me.

@kpdecker
Copy link
Collaborator

Released in 4.0.5

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

No branches or pull requests

2 participants