Vue-devtools: Property or method "toJSON" is not defined

Created on 22 Nov 2017  ·  17Comments  ·  Source: vuejs/vue-devtools

This error happens when i pass the component by param to action in vuex.

To reproduce the error

  //  Call an action in component passing the component as param to vuex
  this.$store.dispatch('metadataAddBox', { component: this });

screenshot

[Vue warn]: Property or method "toJSON" is not defined on the instance but referenced during render. Make sure to declare reactive data properties in the data option.

bug

Most helpful comment

Sentry seems to cause this error

All 17 comments

Yeah, it happens with me too.

I found that elementui triggers this pretty frequently and commented on a thread on their issues page, but I suspect the fix may lie within vue devtools, rather than elementui.

This is probably related to #464

Thanks for the extra information about recursive data @rDr4g0n

Maybe we could treat components like a special type (kinda like RegExp).

Yeah, it cannot be displayed like the other content because of cyclic references, so it needs special treatment

Cyclic references are already taken care of, it must be something else.

oh right, there was a package for that

Today I encountered this error again.

vue: 2.5.13
vuex: 3.0.1
vue-devtools: 4.1.3
element-ui: 2.0.7

screen shot 2018-02-27 at 10 10 54

I'm having this issue too, with element-ui.

how to fix this ? help help help

In my project, I opened the console, by this

window.vConsole = new VConsole();

but when I commented it. It works, the Vue warn was disappeared.

Sentry seems to cause this error

In my case, I used VConsole and print vue instance by console.log(this), then caused this error. Hope this can help.

Sentry seems to cause this error

yep. I close Sentry and fix this error

Sentry seems to cause this error

yep. I close Sentry and fix this error

me too

vConsole

Was this page helpful?
0 / 5 - 0 ratings