DEV Community

Discussion on: State machine advent: Everything you need to master statecharts (24/24)

Collapse
 
gcsalemao7 profile image
Gustavo Carvalho

Hello Mikey I using XStateDevTools but the issue is that the error below is generated. Note: I'm not using TypeScript.

Have you been through this?

Uncaught (in promise) TypeError: Converting circular structure to JSON
--> starting at object with constructor 'Object'
| property 'done.invoke.service-heatmap-id' -> object with constructor 'Array'
| index 0 -> object with constructor 'Object'
| property 'source' -> object with constructor 'Object'
--- property 'on' closes the circle
at JSON.stringify ()
at Object.send (injected.js:41)
at Interpreter.update (interpreter.js:252)
at interpreter.js:127
at Scheduler.process (scheduler.js:64)
at Scheduler.flushEvents (scheduler.js:55)
at Scheduler.schedule (scheduler.js:44)
at Interpreter.send (interpreter.js:121)
at actor.id (interpreter.js:945)

Collapse
 
codingdive profile image
Mikey Stengel

I've not had this error before. Could you share some code?
If I had to guess, you are referencing (parts of) your machine inside the machine, creating a circular structure. The only place where I can see that happening is when you use object getters. xstate.js.org/docs/guides/ids.html...