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

Bug: [Typescript] enqueueActions throws a type error when declared within setup actions #4923

Open
andrecrimb opened this issue May 31, 2024 · 3 comments

Comments

@andrecrimb
Copy link

andrecrimb commented May 31, 2024

XState version

XState version 5

Description

TS throws an error when enqueuedActions is declared within setups > actions.

Expected result

No type error should be raised.

Actual result

Screenshot 2024-05-31 at 11 02 37

Reproduction

Sandbox link

Additional context

xstate: 5.13.0
typescript: "5.3.3

@davidkpiano
Copy link
Member

Which TypeScript version are you using?

Regardless this may be a TS limitation (cc. @Andarist)

@andrecrimb
Copy link
Author

Sorry, I forgot to add it into the description.
"typescript": "5.3.3"

@bsunderhus
Copy link

bsunderhus commented Sep 6, 2024

Bumped into the same issue: https://stackblitz.com/edit/vitejs-vite-rggwb5?file=src%2Fmain.ts

Seems like the TActions generic is resolving to never on enqueue declaration
image

xstate: "5.18.1"
typescript: "5.5.4"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants