-
Notifications
You must be signed in to change notification settings - Fork 422
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
Mustache: DOM exception when applying certain block patterns #243
Comments
Is this referring to "NOT_FOUND_ERR: DOM Exception 8" ? I was about to post a bug about this. Here is what I have seen; Given a model with attr 'name' and a proto function isLoggedIn(), handing it to the following mustache file, this will cause the exception. {{#isLoggedIn}}{{name}}{{/isLoggedIn}} Can.js : line 5872 Same error in FF: "Not Found Error: Node was not found" |
That is indeed the issue I am seeing. As far as I can tell, it's not a null-reference type of issue; it may be that we are causing CanJS to try to insert a text node in a parent while providing a positioning reference that is not a child of the parent. I have not yet investigated it further than this. |
Ignore this comment. Apologies about the spam. Testing our community page. |
This is actually a pretty major issue as you can't even do simple bound lists with mustache. Even #each doesn't work. Who decides when this should be labeled a bug? |
This is the same issue as #153 right? |
Yes. Sorry, it is. At least for the cases I am running into. |
Ok makes sense. Does the workaround mentioned there work for you for? We'll try our best making this fix a priority for Mustache in the 1.1.4 release. |
Works great! All the work that has been put into this is incredible. |
With 1.1.4, using an {{#if}} block no longer throws errors, but also does not display text. My comments in #241 seem to apply here as well. updated fiddle for 1.1.4: http://jsfiddle.net/B8kWR/2/ |
This is fixed with the fixes for #153. Updated fiddle with the fix copy+pasted: http://jsfiddle.net/B8kWR/8/ |
Eep. I also used {{^if ...}} in the test for #292 (it passed, though). Would you mind boyscouting that if you are working near it? https://github.com/bitovi/canjs/blob/master/view/mustache/test/mustache_test.js#L1342 Thanks. |
It looks like that does work now. That must have been something that changed between the version of Mustache in that fiddle and latest. |
http://jsfiddle.net/B8kWR/1/
Similar to #241 but outside of attributes, when using can.Observes to live-bind, this pattern will cause an error in the escape case in can.Mustache.txt (adding a newly generated text node). This is on Chrome 24; other browsers have not been tested.
Workaround: for the case of "show a, or b if a does not exist" try these helpers from github/recipocity/grc:
The text was updated successfully, but these errors were encountered: