-
-
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
TypeError: Cannot read properties of undefined (reading 'name') #2880
Comments
I can confirm that this is a bug - and most likely a duplicate of another issue. I will try to look into this after the weekend as I already exactly know what happens, just need to figure out the most appropriate solution and write tests for this and related scenarios. |
Just an update - I'm implementing a fix for this, should open a PR in a couple of days. The issue/fix is somewhat delicate so I'm making sure to cover as many edge cases as I can. |
Hey @Andarist any update on this? I'm having the issue when sending an event from child to grandchild machine, here is a CDS for it: https://codesandbox.io/s/xstate-stop-parent-child-grandchild-tuv3nk?file=/src/App.tsx when stoping the parent machine by clicking the button there's another error related to not being able to read |
Description
When a child machine has been in a state with the
exit: sendParent
action set, if the parent machine stop, then the error will be thrown.I guess this is because the parent has been destroyed before the child.
Expected Result
The interpreter should be stopped gracefully. (executed all the
exit
from all children before destroy parent?)Actual Result
Reproduction
https://codesandbox.io/s/loving-sutherland-y3he8?file=/src/index.ts
Additional context
The text was updated successfully, but these errors were encountered: