#Uncaught TypeError _owner is read-only

1 messages · Page 1 of 1 (latest)

fierce ferry
#

I'm getting an error when using the dev tools. Probably best to create a repro.

#

Does the context need to be serializable? That might be an issue.

#

Yeah that's it...

#

How to I mount an unmount some DOM element? My idea was to store it in the context...

terse mist
#

What do you mean by dev tools?

fierce ferry
#

The vizualiser.

#

@xstate/inspect

#

It crashes with non-serializable context.

terse mist
#

Ok that’s the inspector 🙂

fierce ferry
#

Yeah you pass {devTools: true} so I call it dev tools 🙂

terse mist
#

So yeah the machine config including the context need to be serializable to be sent over the network

fierce ferry
#

Do you know a good work around for this use case?

terse mist
#

Can you instead save a reference to the element like a function that executes a document.querySelector?

#

Assuming you don’t need the dom element itself and only need to have a reference to it.

fierce ferry
#

Might work...

terse mist
#

you can then call that function in the invocations and actions when you need the element itself.

fierce ferry
#

I can also use a global variable I guess.

terse mist
fierce ferry
#

I wish there was a way to disable sending the context over the wire.

#

But thank you, very helpful. Should I maybe make an issue so that at least a more helpful error message can be logged?

terse mist
#

Inspector could be more configurable but we’re planning to have an inspector mode in the visual editor.

fierce ferry
#

Will the inspector be deprecated then?

terse mist
terse mist
fierce ferry
#

(popup as any).toJSON = () => "popup";

#

this also worked

terse mist
#

is popup a DOM element?

fierce ferry