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

4.0.7 release breaks {{#if @partial-block}} usage #1341

Closed
jithine opened this issue May 2, 2017 · 3 comments
Closed

4.0.7 release breaks {{#if @partial-block}} usage #1341

jithine opened this issue May 2, 2017 · 3 comments

Comments

@jithine
Copy link

jithine commented May 2, 2017

TypeError: Cannot read property 'data' of undefined
    at Object.partialBlockWrapper (/Users/me/app/node_modules/express-handlebars/node_modules/handlebars/dist/cjs/handlebars/runtime.js:264:49)
    at Object.<anonymous> (/Users/me/app/node_modules/express-handlebars/node_modules/handlebars/dist/cjs/handlebars/helpers/if.js:10:33)
    at Object.eval (eval at createFunctionContext (/Users/me/app/node_modules/express-handlebars/node_modules/handlebars/dist/cjs/handlebars/compiler/javascript-compiler.js:254:23), <anonymous>:10:32)
    at main (/Users/me/app/node_modules/express-handlebars/node_modules/handlebars/dist/cjs/handlebars/runtime.js:175:32)
    at ret (/Users/me/app/node_modules/express-handlebars/node_modules/handlebars/dist/cjs/handlebars/runtime.js:178:12)
    at ret (/Users/me/app/node_modules/express-handlebars/node_modules/handlebars/dist/cjs/handlebars/compiler/compiler.js:525:21)
    at Object.invokePartial (/Users/me/app/node_modules/express-handlebars/node_modules/handlebars/dist/cjs/handlebars/runtime.js:281:12)
    at Object.invokePartialWrapper [as invokePartial] (/Users/me/app/node_modules/express-handlebars/node_modules/handlebars/dist/cjs/handlebars/runtime.js:68:39)
    at Object.eval (eval at createFunctionContext (/Users/me/app/node_modules/express-handlebars/node_modules/handlebars/dist/cjs/handlebars/compiler/javascript-compiler.js:254:23), <anonymous>:12:28)
    at main (/Users/me/app/node_modules/express-handlebars/node_modules/handlebars/dist/cjs/handlebars/runtime.js:175:32)

Works fine with 4.0.6 release, was there any breaking changes with 4.0.7 ?

@nknapp
Copy link
Collaborator

nknapp commented May 2, 2017 via email

@jithine
Copy link
Author

jithine commented May 2, 2017

@nknapp I narrowed it down to this usage which was working in 4.0.6 but breaking with 4.0.7.

partial.handlebars

...
    {{#> submitcontainer}}
    <button formaction="{{deleteUrl}}" data-type="{{type}}">Delete</button>
    {{/submitcontainer}}

...

submitcontainer.handlebars

...
  {{#if @partial-block}}
  {{> @partial-block }}
  {{/if}}
...

4.0.7 is not handling {{#if @partial-block}} check. This is a working usage with 4.0.6

Also if I call submitcontainer partial like this it does not break {{> submitcontainer}}

@jithine jithine changed the title 4.0.7 release breaks partials 4.0.7 release breaks {{#if @partial-block}} usage May 2, 2017
nknapp added a commit that referenced this issue May 2, 2017
Closes #1341

If the @partial-block is called as parameter of a helper (like in
{{#if @partial-block}}...{{/if}}, the partialBlockWrapper is executed
without "options"-parameter. It should still work in without an error
in such a case.
nknapp added a commit that referenced this issue May 2, 2017
Closes #1341

If the @partial-block is called as parameter of a helper (like in
{{#if @partial-block}}...{{/if}}, the partialBlockWrapper is executed
without "options"-parameter. It should still work in without an error
in such a case.
@nknapp
Copy link
Collaborator

nknapp commented May 2, 2017

The bug is now fixed and a new release 4.0.8 is published. I decided to publish immediately (instead of waiting for feedback) since this was only a small fix.

Thanks for your example. It helped a lot (and is the basis for the regression-test)

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

2 participants