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

Can't edit component data if no props #882

Closed
kevinmarrec opened this issue Feb 13, 2019 · 8 comments
Closed

Can't edit component data if no props #882

kevinmarrec opened this issue Feb 13, 2019 · 8 comments
Labels
bug need team repro We acknowledged your report and will soon try to reproduce it

Comments

@kevinmarrec
Copy link

kevinmarrec commented Feb 13, 2019

Version

5.0.0-beta.4

Browser and OS info

Chrome 72 / Windows 10

Steps to reproduce

  1. Define a minimal component with an array of any type in data (array of numbers for example)
export default {
  data () {
    return {
      someArray: [1, 2]
    }
  }
}
  1. Try do edit the array in Vue DevTools

What is expected?

Edit or deleting an item works

What is actually happening?

Edit, deleting (and also increment/decrement) throws an error :
Cannot read property 'someArray' of undefined

Stack Trace

screenshot_6


Editing the array manually from root edit button works (JSON edit)

@Akryum Akryum added bug need team repro We acknowledged your report and will soon try to reproduce it cannot reproduce We cannot reproduce the problem with the given information. More env information needed. and removed bug need team repro We acknowledged your report and will soon try to reproduce it labels Mar 20, 2019
@Akryum
Copy link
Member

Akryum commented Mar 20, 2019

I don't reproduce this on dev branch.

@davidwaterston
Copy link

I don't reproduce this on dev branch.

By 'dev branch' do you mean Beta 5?
I've just updated to B5 via https://chrome.google.com/webstore/detail/vuejs-devtools/ljjemllljcmogpfapbkkighbhhppjdbg and this is still broken i.e. it is not possible to edit the data within an object or array, as described by @kevinmarrec.

Version
5.0.0-beta.5

Browser and OS info
Chrome 72.0.3626.121 (Official Build) (64-bit) / MacOS Mojave 10.14.3.

@kevinmarrec
Copy link
Author

@Akryum Issue is still present and reproducible on Beta 5.

The issue happens almost for each feature when the variable is an array :

  • Adding a value in an array
  • Remove an item from an array
  • Editing an item in an array
  • Incrementing an item (if it's numeric) in an array

Error: Cannot read property 'NAME_OF_THE_ARRAY' of undefined (with NAME_OF_THE_ARRAY being the name of your array variable).

@sp1ker
Copy link
Contributor

sp1ker commented Mar 21, 2019

I don't reproduce this on dev branch.

You should edit in devtools instead in vue app. Component must be without props.

@kevinmarrec I fixed bug. Wait merge by @Akryum if good commit.

@kevinmarrec
Copy link
Author

@sp1ker Great !

What do you mean by component without props ?
If the component has no props, it makes devTools buggy for all other datas of the component ?

@sp1ker
Copy link
Contributor

sp1ker commented Mar 22, 2019

If the component has no props, it makes devTools buggy for all other datas of the component ?

Yes

@kevinmarrec
Copy link
Author

Oh alright, need to wait @Akryum for further information and see if it's the right fix :)

@Akryum Akryum changed the title Beta 4 : Edit arrays of component datas not working Can't edit component data if no props Mar 23, 2019
@Akryum Akryum added bug need team repro We acknowledged your report and will soon try to reproduce it and removed cannot reproduce We cannot reproduce the problem with the given information. More env information needed. labels Mar 23, 2019
@Akryum
Copy link
Member

Akryum commented Mar 23, 2019

Closed in #907

@Akryum Akryum closed this as completed Mar 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug need team repro We acknowledged your report and will soon try to reproduce it
Projects
None yet
Development

No branches or pull requests

4 participants