Skip to content
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

XState: Cannot read property 'name' of undefined #6

Open
huan opened this issue Dec 17, 2021 · 0 comments
Open

XState: Cannot read property 'name' of undefined #6

huan opened this issue Dec 17, 2021 · 0 comments
Labels
bug Something isn't working

Comments

@huan
Copy link
Member

huan commented Dec 17, 2021

When we call interepter.stop() in a state where it has a exit: actions.sendParent(), then the below error will be thrown:

    not ok 19 - Cannot read property 'name' of undefined
      ---
      stack: |
        Interpreter.sendTo (node_modules/xstate/lib/interpreter.js:137:23)
        Interpreter.exec (node_modules/xstate/lib/interpreter.js:793:18)
        node_modules/xstate/lib/interpreter.js:571:17
        Array.forEach (<anonymous>)
        Interpreter.stop (node_modules/xstate/lib/interpreter.js:564:30)
        node_modules/xstate/lib/interpreter.js:588:15
        Map.forEach (<anonymous>)
        Interpreter.stop (node_modules/xstate/lib/interpreter.js:586:19)
        Test.<anonymous> (file://src/mailbox/mailbox.spec.ts:177:15)
      at:
        line: 137
        column: 23
        file: node_modules/xstate/lib/interpreter.js
        function: Interpreter.sendTo
      type: TypeError
      tapCaught: returnedPromiseRejection
      test: "mailbox actor interpret smoke testing: 3 parallel EVENTs"
      source: >2
                target.send(_tslib.__assign(_tslib.__assign({}, event), {
                  name: event.name === actionTypes.error ? "".concat(actions.error(_this.id)) : event.name,
        ----------------------^
                  origin: _this.sessionId
                }));
      ...
    
    1..19
    # failed 1 of 19 tests

Related issues

@huan huan added the bug Something isn't working label Dec 17, 2021
huan added a commit that referenced this issue Dec 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant