Giter VIP home page Giter VIP logo

Comments (9)

yyx990803 avatar yyx990803 commented on May 6, 2024

Can you add a debugger statement there and see what data contains? This error is usually thrown when the data to be sent contains non-plain objects e.g. functions.

from devtools.

OEvgeny avatar OEvgeny commented on May 6, 2024

Yes I did this. It contains component props. One of them was a function.

from devtools.

OEvgeny avatar OEvgeny commented on May 6, 2024
event: "instance-details"
payload: Object
    id: 4
    name: "Datatable"
    state: Array[5]
        0: Object
            key: "items"
            meta: Object
            type: "prop"
            value: Array[8]
            __proto__: Object
        1: Object
            key: "onSelect"
            meta: Object
            binding mode: "default"
            required: false
            type: "Function"
            __proto__: Object
...

from devtools.

yyx990803 avatar yyx990803 commented on May 6, 2024

Can you be more specific about where the function was found?

from devtools.

OEvgeny avatar OEvgeny commented on May 6, 2024

Did you mean component definition? If yes, it looks like:

<script>
module.exports = {
  methods: {
    doSomething () {/* */}
  },
  components: {
    datatable: {
      props: {
        items: /*  */,
        onSelect {
          type: Function,
          default () {return function () {}}
        }
      }
    }
  }
}
</script>

<template>
<datatable :on-select="doSomething"></datatable>
</template>

When I click to <datatable> in vue-devtools I am getting error described above.
It may be because in shells/chrome/src/backend.js line 26 data.payload.state[1].type is a Function for this component.

If something is wrong with my answer, sorry :) Let me know if I can provide additional information for this.

from devtools.

OEvgeny avatar OEvgeny commented on May 6, 2024

It looks like I did something the other way this time. There is value property in data.payload.state[1] what contains function... So it looks like:

event: "instance-details"
...
payload: Object
  state: [5]
    ...
    1: Object
      key: "onSelect"
      meta: Object
      type: "prop"
      value: function (a)
      __proto__: Object

from devtools.

OEvgeny avatar OEvgeny commented on May 6, 2024

Adding filtration for value makes it work well:

  if (data.payload.state) {
    data.payload.state = data.payload.state.filter(function (el) {
      return !(el.value instanceof Function)
    })
  }

It seems we should somehow replace these functions with something else...

from devtools.

yyx990803 avatar yyx990803 commented on May 6, 2024

Ok, should be fixed in 1.0.1 with proper sanitization before sending the data.

from devtools.

OEvgeny avatar OEvgeny commented on May 6, 2024

Thanks, Evan!

from devtools.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.