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

Fix #1881 + related ospec bug #2492

merged 2 commits into from
Jul 26, 2019


Copy link


Motivation and Context

Fixes #1881

Also fixes a related ospec bug, but I can't seem to find it. (Maybe on Gitter?)

How Has This Been Tested?

Ran the usual tests. Had to update the mocks so the fuzzer would be seeing an accurate, albeit incomplete, view of the world. (Browsers know how to batch changes in fragments, so the extra removals aren't critical.)

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation change


  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.
  • I have updated docs/

@project-bot project-bot bot added this to Needs triage in Triage/bugs Jul 26, 2019
@dead-claudia dead-claudia marked this pull request as ready for review July 26, 2019 22:13
@dead-claudia dead-claudia merged commit 39fa2b3 into MithrilJS:next Jul 26, 2019
Triage/bugs automation moved this from Needs triage to Closed Jul 26, 2019
@dead-claudia dead-claudia deleted the fix-remove branch July 26, 2019 22:19
Copy link

rhinoman commented Aug 1, 2019

This fix seems to have broken me. Since updating, I've been getting errors stemming from:

function removeHTML(parent, vnode) {
	for (var i = 0; i < vnode.instance.length; i++) {

Where sometimes vnode.instance is undefined and thus an exception is being thrown (Can't read property 'length' of undefined).

Copy link

knupska commented Aug 2, 2019

I recently upgraded to v2.0.3 and was receiving precisely the same error as @rhinoman above, originating from the removeHTML function in render/render.js.

TypeError: Cannot read property 'length' of undefined

By checking if the vnode.instance === undefined I was able to determine that it was occuring on the only remaining that I had in the entire application.

Luckily in my case I didn't actually need the, so removed it to return m( 'div', text ), instead of m( 'div', text ) ), and that has seemingly resolved the issue for me.

Copy link
Member Author

@rhinoman @knupska See #2498.

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

Successfully merging this pull request may close these issues.

(Edge case) Elements are not being removed when promise resolves in onbeforeremove
3 participants