wobsoriano / pinia-xstate

Put your xstate state machines into a global pinia store.
MIT License
55 stars 4 forks source link

Cannot stringify arbitrary non-POJOs #7

Open mod08 opened 5 months ago

mod08 commented 5 months ago

First of all, thank you for creating this package!

I'm trying to use is with SSR enabled but get the error Cannot stringify arbitrary non-POJOs. With disabled SSR it works fine.

Reproduction: https://stackblitz.com/edit/nuxt-starter-dbfgrh?file=nuxt.config.ts,store.ts

As far as I understand it has todo with the renderJsonPayloads functionality, which is revivifying complex types. With SSR enabled and renderJsonPayloads disabled it works as well.

Do you have any Idea on how to make it work with renderJsonPayloads enabled?

wobsoriano commented 5 months ago

I'll look into this asap

mod08 commented 5 months ago

Update: It doesn't work with SSR enabled and renderJsonPayload disabled.

Means the error is gone but the store doesn't work.

CleanShot 2024-05-31 at 17 46 58@2x

wobsoriano commented 5 months ago

Defo didnt test this package with SSR so thanks for reporting that issue