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

[2.3.0] Uncaught TypeError: Cannot set property 'isRootInsert' of null #5536

Closed
sqal opened this issue Apr 27, 2017 · 1 comment
Closed

[2.3.0] Uncaught TypeError: Cannot set property 'isRootInsert' of null #5536

sqal opened this issue Apr 27, 2017 · 1 comment

Comments

@sqal
Copy link
Contributor

sqal commented Apr 27, 2017

Version

2.3.0

Reproduction link

2.3.0 - https://jsfiddle.net/f0n7jmL7/
2.2.6 - https://jsfiddle.net/eu1q0a8b/

Steps to reproduce

  1. Open bug reproduction for 2.3.0 and check console.log - you ca see an error
  2. Make change in FormErrors component so it will return empty span tag instead of null value at the end - no error this time and the example works fine

What is expected?

i expect the above example to work as it did in vue@2.2.6

What is actually happening?

Vue throws an error Uncaught TypeError: Cannot set property 'isRootInsert' of null when functional component returns null value instead of vnode.

// EDIT: Also something I noticed in 2.3.0. If you will return undefined instead of null at the end of FormErrors, then our example works again.

@gebilaoxiong
Copy link
Member

gebilaoxiong commented Apr 27, 2017

HI, I think this problem is caused when creating vnode

https://github.com/vuejs/vue/blob/dev/src/core/vdom/create-element.js#L102

in 2.2.6:

  if (vnode) {
    if (ns) { applyNS(vnode, ns); }
    return vnode
  } else {
    return createEmptyVNode()
  }

because of your component FormErrors return null so...

You can temporarily output an empty element to solve it return undefined

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

No branches or pull requests

2 participants