statelyai / xstate

Actor-based state management & orchestration for complex app logic.
https://stately.ai/docs
MIT License
27.21k stars 1.26k forks source link

Bug: seems non-JSON serializable values interfere with inspector operation #5114

Open aryzing opened 2 weeks ago

aryzing commented 2 weeks ago

XState version

XState version 5

Description

Seems that when using non-JSON serializable values within a machine the inspector @statelyai/inspect stops updating its UI or showing values in its explorer. For example, a fromPromise that returns a BigInt will "crash" the inspector UI and it will not update when the promise completes, even if the internal machine state did transition.

Expected result

Was expecting the inspector to be capable of handling all values.

May not be worth the effort to add support for more value types, although would definitely help if this constraint was documented (if it isn't already? I couldn't find it).

Actual result

No reactive UI updates after the machine processes a non-JSON serializable value.

Reproduction

n/a

Additional context

No response

davidkpiano commented 2 weeks ago

Can you share a small repro? 🙏

aryzing commented 2 weeks ago

Sure, give this one a try,

https://github.com/aryzing/repro-xstate-bigint