mithril.js: Uncaught DOMException: Failed to execute 'removeChild' on 'Node'

Steps to Reproduce:

  1. Make changes in an input that has an oninput event.
  2. Immediately navigate to another page using the browser’s back or forward button.

Environment: Mithril 1.0.1 on Chrome 56.0.2924.87 (Windows 10).

Previous Related Issue: #358

Sample Code:

module.exports =
  { oninit:
      vn => {
              const id = Number( vn.attrs.id )
              const stream = M.loadItem( id )
              vn.state.data = { id, stream, initial: stream() }
            }
  , view: vn =>
    <div>
      <label class="label">
        Last Name
        <input
          class="input"
          type="text"
          placeholder="Last Name"
          onchange={ X.setStreamPropToValueAttr( vn.state.data.stream )( 'lastName' ) }
          value={ X.getStreamProp( vn.state.data.stream )( 'lastName' ) }
        />
      </label>
    </div>
  }

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 20 (15 by maintainers)

Commits related to this issue

Most upvoted comments

So finally, a fix incoming in #2286.

@isiahmeadows I’ve just confirmed that the behavior persists when the component in question is stripped to bare bones:

import m from 'mithril'
module.exports =
  { view: vn =>
      <input onchange={ console.log } />
  }

It persists when I swap out the JSX syntax for javascript:

import m from 'mithril'
module.exports =
  { view: vn =>
      m( 'input', { onchange: console.log } )
  }

It persists when I switch to ES5 syntax, getting rid of the arrow function:

import m from 'mithril'
module.exports =
  { view: function () {
      return m( 'input', { onchange: console.log } )
    }
  }