#Connect machines to Inspector

1 messages · Page 1 of 1 (latest)

lament quiver
#

I have a React app with a number of existing machines instrumented with the Inspector. Upon launching the Inspector, I was hopeful to see my machines visualized with live events showing their state.

#

Do I need to be using a different URL for the Inspector window?

    // Open the inspector in a new window
    const inspectorWindow = window.open(
      "https://stately.ai/registry/editor/embed?inspect",
      "XStateInspector",
      "width=1200,height=800,menubar=no,toolbar=no,location=no,status=no"
    );
opaque urchin
lament quiver
#

@opaque urchin thanks for confirming. Yes, this is the tool that we're attempting to use. No doubt, we've missed something obvious. In this file, we launch the Inspector tool. Separately, we instrument the machines with Inspector, so live events can be seen in the Inspector browser.

lament quiver
lament quiver
#

I wonder where we're going wrong in our attempted use of the Inspector.

lament quiver
#

Does anyone see anything obvious that we're doing wrong (in the React snippet above)?

#

If we don't crack this one today, we'll toss in the towel on Inspector.

#

@meager socket @opaque urchin pointers, appreciated.

wintry thistle
#

I don't think you can open the window manually, you have to enable auto start or call .start(), which registers the communication handlers and updates the status.

lament quiver
#

Thank you, @wintry thistle. As another test, I set aside the code above entirely and have made three lines changes to an existing actor based on the example in the inspector readme.md. While the Inspector popup window opens, it unfortunately, freezes my both tabs of my browser: my app and the inspector window never loads - as if the browser's event loop is frozen.

#

It's worth noting that some components of my app, including Xstate actors are dynamically loaded via remote-component. As a library xstate is packaged in both the base level app and in the remotely loaded components.

wintry thistle
#

Sorry, I'm not familiar with remote-component 😕 Maybe someone else can help you with that

lament quiver
#

@opaque urchin a final ping before I toss in the towel...

opaque urchin