-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug[v5] An inline child actor cannot be persisted. #4410
Comments
This is working as expected; we currently cannot serialize arbitrary actor logic, nor do we plan to do this since it would require essentially serializing fully executable code. The machine needs to have the actor already defined (named |
We might be able to improve the situation for the new |
If I have a generated actor, then I cannot get PersistedState? Sorry for Google translator. |
No worries; in your code, you are passing an entire machine definition in the event. I would recommend another way of modeling it so that the machine knows about the other kinds of machines it can spawn already, instead of having that passed through an event. |
Thanks for your reaction. |
is it possible to use actors without a parent actor in a single system? |
Are there any changes in this regard? |
What kind of an inline child actor you'd like to persist? Could you show how your machine looks like? |
Description
Expected result
Actual result
{"value":"idle","status":"active","historyValue":{},"context":{"atoms":{"atom":{"xstate$$type":1,"id":"child"}}},"children":{"child":{"state":{"value":"idle","status":"active","historyValue":{},"context":{},"children":{}},"systemId":"child-id"}}}
Reproduction
https://stackblitz.com/edit/sveltejs-kit-xstate?file=src%2Froutes%2F%2Bpage.svelte
Additional context
ts without sveltekit worked
https://stackblitz.com/edit/xstate-ts?file=index.ts
The text was updated successfully, but these errors were encountered: