-
Notifications
You must be signed in to change notification settings - Fork 77
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
contentFor yields strange results when combined with asyncHelper #55
Comments
That looks like the placeholder ID for the async helper, which replaced when the promise completes. I'll look tomorrow. |
It's also worth to note that the line at https://github.com/halfdan/hbs-weird/blob/master/views/index.hbs#L3 does not show up in the output. |
The missing line is due to The problem was blocks in the layout were not checking for async results. Please checkout the branch |
@mgutz Seems to work perfectly! So I'm 👍 for the merge. |
@mgutz Unfortunately we discovered another related issue just a few minutes ago. When using an async helper inside a block and passing it as a parameter to another helper, the same issue still seems to appear. |
Please update your example project or edit the test and I'll try fixing. |
We currently experience a weird issue with an asynchronous helper when it is used inside a contentFor. (TryGhost/Ghost#2127)
I wrote a small app that demonstrates the issue at: https://github.com/halfdan/hbs-weird
The output looks like the following:
Instead of getting
12
as output for both usages of the{{weird}}
helper the one used in thecontentFor
returns a hash of some kind. I managed to track it down to being the result of the following line: https://github.com/barc/express-hbs/blob/master/lib/hbs.js#L566 which seems to return the shown value as a string (changes for every request).The text was updated successfully, but these errors were encountered: