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: "An inline child actor cannot be persisted." error. #5057

Open mkhsanov opened 2 months ago

mkhsanov commented 2 months ago

XState version

XState version 5

Description

In case if I try to create persisted snapshot with getPersistedSnapshot for actor which contains child spawned actors xstate raises an error.

Expected result

Crate persisted snapshot with child spawned actors.

Actual result

image

xstate raises an error with text "An inline child actor cannot be persisted."

Reproduction

https://codesandbox.io/p/live/47d8d896-243b-40a5-9a76-dafd43bb4847

Additional context

No response

mkhsanov commented 2 months ago

You may find the error in the console output.

davidkpiano commented 2 months ago

Have you tried moving the actor to not be an inline actor, and instead be a referenced actor?

remake99 commented 1 month ago

Have you tried moving the actor to not be an inline actor, and instead be a referenced actor?

I have the same problem, but after following your instructions, it is resolved now.