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

genChildren function with error normalizationType #9181

Closed
skyline0705 opened this issue Dec 11, 2018 · 1 comment
Closed

genChildren function with error normalizationType #9181

skyline0705 opened this issue Dec 11, 2018 · 1 comment

Comments

@skyline0705
Copy link

skyline0705 commented Dec 11, 2018

Version

2.5.19

Reproduction link

https://codepen.io/anon/pen/roaKMY

Steps to reproduce

open the link and open the console

What is expected?

console should not has error, and the result in dom should be empty

What is actually happening?

console shows "Cannot read property 'length' of undefined
​ at simpleNormalizeChildren"


before the version 2.5.16, it works fine, and I saw the source, when compile the template, function genChildren choose an error normalizationType, it should be ALWAYS_NORMALIZE.

and I think there is something wrong when compiling v-for and component with an "undefined" list because I find this words in 'src/core/vdom/helpers/normalize-children.js':

// 2. When the children contains constructs that always generated nested Arrays,
// e.g. <template>, <slot>, v-for, or when the children is provided by user
// with hand-written render functions / JSX. In such cases a full normalization
// is needed to cater to all possible types of children values.

@niutech
Copy link

niutech commented Dec 11, 2018

I can confirm this issue in vue@2.5.20 when obj is undefined in v-for="o in obj".

f2009 pushed a commit to f2009/vue that referenced this issue Jan 25, 2019
aJean pushed a commit to aJean/vue that referenced this issue Aug 19, 2020
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

3 participants