Error encountered after upgrading xstate to v5.9.1: TypeError: this.logic.getInitialSnapshot is not a function #4824
Replies: 5 comments
-
|
Please always try to share a repro case in a runnable form - either by providing a git repository to clone or a codesandbox. OSS maintainers usually can't afford the time to set up the repro, even if exact steps are given. |
Beta Was this translation helpful? Give feedback.
-
|
Are you using TypeScript? Are there any TypeScript errors when passing the logic into |
Beta Was this translation helpful? Give feedback.
-
|
Hey, did you managed to solve this issue? I'm encountering the same problem moving from 4 to 5 |
Beta Was this translation helpful? Give feedback.
-
|
@pubudithajayasekara I believe that this is a duplicate of this issue. |
Beta Was this translation helpful? Give feedback.
-
|
This can be helpful for the fix. I found the root issue: https://medium.com/@constructordog/fixing-getinitialsnapshot-is-not-a-function-in-xstate-v5-after-your-llm-betrayed-you-and-the-de62b0b134ec |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Description:
I recently upgraded xstate from version 4.38.3 to version 5.9.1 following the migration guide provided here. However, upon making the necessary changes, I encountered the following error:
TypeError: this.logic.getInitialSnapshot is not a function (it is undefined), js engine: hermesThis error leads to the raise-182bb5c9.cjs.js file in the xstate node module, specifically in the _initState method.
Beta Was this translation helpful? Give feedback.
All reactions