Git Product home page Git Product logo

Comments (17)

jimmypuckett avatar jimmypuckett commented on August 27, 2024 5

So I have an instance of leaflet map inside the vue instance & a string (API token for leaflet). I'm pretty sure that is all.

from devtools.

yyx990803 avatar yyx990803 commented on August 27, 2024

What does the error stack look like?

from devtools.

jimmypuckett avatar jimmypuckett commented on August 27, 2024

Here you go...

Uncaught TypeError: Converting circular structure to JSON
Save.stringify @ extensions::SafeBuiltins:82
PortImpl.postMessage @ extensions::messaging:53
target.(anonymous function) @ extensions::SafeBuiltins:19
publicClass.(anonymous function) @ extensions::utils:94
sendMessageToDevtools @ proxy.js:73

from devtools.

skyrpex avatar skyrpex commented on August 27, 2024

Pretty sure you've got an object inside itself somewhere in your data. Should vue-devtools handle this case?

from devtools.

rigor789 avatar rigor789 commented on August 27, 2024

Just came across this issue, in my case I have an object (es6 class) that gets the $vm in it's constructor, and then the object is set in the vm's $data array and that causes a circular reference that can't be converted to JSON.

from devtools.

gdecris avatar gdecris commented on August 27, 2024

I am having the same issue using Mapbox (built on Leaflet). Makes me wonder if that is no coincidence. This could be an issue with how the Leaflet object is structured.

from devtools.

rigor789 avatar rigor789 commented on August 27, 2024

I personally restructured my code, and didn't have any more issues after that. Basically I have a class that gets $vm through the constructor, but I don't set that object as a $data attribute to avoid circular references.

from devtools.

srhise avatar srhise commented on August 27, 2024

Having the same issue with google maps

from devtools.

EdwardNelson avatar EdwardNelson commented on August 27, 2024

I too am having the same problem with google maps

from devtools.

Glutnix avatar Glutnix commented on August 27, 2024

Vue Devtools should definitely handle circular references gracefully.

When Vue Devtools is generating the data/property value tree, it should check to see if an object is the same object as any of its ancestors, and instead of going deeper, show "«circular reference»".

from devtools.

srhise avatar srhise commented on August 27, 2024

@Glutnix where in the code does that occur? Sounds like something this group could fix for @yyx990803

from devtools.

Glutnix avatar Glutnix commented on August 27, 2024

I don't know, I haven't consulted the source code. I just described how you prevent circular references.

from devtools.

yyx990803 avatar yyx990803 commented on August 27, 2024

fixed via 2a626a3

from devtools.

Glutnix avatar Glutnix commented on August 27, 2024

Thank you Evan!

from devtools.

codeofsumit avatar codeofsumit commented on August 27, 2024

I still have this issue in vue 2.0-rc.6 with leaflet

from devtools.

alanwei43 avatar alanwei43 commented on August 27, 2024

@codeofsumit try circular-json:

const CircularJSON = require('circular-json');

let json = CircularJSON.stringify(yourObject);

from devtools.

vahlo avatar vahlo commented on August 27, 2024

I'm working with Typescript + Vue project, had this error when working with openlayers.

The fix for me was to : Mounted() { } in my .ts file.

Ref: https://forum.vuejs.org/t/reference-an-inner-div-inside-of-template/19903/2

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.