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

can.appendChild passed null el #1621

Closed
JustinLove opened this Issue Apr 16, 2015 · 1 comment

Comments

Projects
None yet
2 participants
@JustinLove

JustinLove commented Apr 16, 2015

2.2.4, using amd-dev

The required pieces seem to be:

  • Component viewModel with null or missing attribute, which is later set to a list
  • Attribute used in stache #each
  • The second time that attribute is set, Cannot read property 'appendChild' of null

I traced it back as far as live.js, line 92; masterNodeList has one element, a text node with a parent, but the index check makes the call to element.after substitute [text], which has a parentless node. element.after passes the parent (null) to appendChild.

Workaround: make the attribute default to an empty array.

Reproduction: http://jsbin.com/misoku/2/edit

@daffl daffl added the bug label Apr 21, 2015

@daffl daffl added this to the 2.2.5 milestone Apr 21, 2015

@daffl

This comment has been minimized.

Show comment
Hide comment
@daffl

daffl Apr 21, 2015

Contributor

I think this is the same issue that the #1634 pull request addresses.

Contributor

daffl commented Apr 21, 2015

I think this is the same issue that the #1634 pull request addresses.

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