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

Mustache - TypeError: Cannot read property 'childNodes' of null #425

Closed
sporto opened this issue Jun 11, 2013 · 4 comments
Closed

Mustache - TypeError: Cannot read property 'childNodes' of null #425

sporto opened this issue Jun 11, 2013 · 4 comments
Assignees
Milestone

Comments

@sporto
Copy link
Contributor

sporto commented Jun 11, 2013

This seems to be a bug

See
http://jsbin.com/ilinax/1/edit

This throws TypeError: Cannot read property 'childNodes' of null

If you remove this piece of code:

   {{#state.loading}}
        Loading
   {{/state.loading}}

It works.

If you remove the table it works.

But the combination of the two blocks throws.

@sporto
Copy link
Contributor Author

sporto commented Jun 11, 2013

Another example
http://jsbin.com/unigav/2/

@sporto
Copy link
Contributor Author

sporto commented Jun 11, 2013

Also in EJS
http://jsbin.com/unigav/3/

@justinbmeyer
Copy link
Contributor

You need a wrapping element around live text elements. Something like:

<span>
   {{#state.loading}}
        Loading
   {{/state.loading}}
</span>

otherwise, we have no parent element to update the live part relative to. We might be able to fix this by modifying the document fragment temporarily.

@shcarrico
Copy link
Contributor

Should we throw a dev mode warning for this, or try to code a workaround?

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

4 participants