Open flugg opened 8 hours ago
I also found this issue which seems to have the same issue, but was closed without further investigation.
And as the reproduction above seems to prove, this doesn't seem to have anything to do with the size of the machines.
XState version
XState version 5
Description
I'm trying to create a package that creates a reusable state machine. I've simplified our machine to locate the error being the
not
function:Expected result
I expected the typings to be built without issues.
Actual result
When trying to build types for the packages, I get the following error:
It seems like the issue stems from the
not
function referencing theGuardPredicate
type which is not exported by XState and TypeScript is unable to build a type for it without this reference.Reproduction
https://codesandbox.io/p/devbox/angry-goldberg-v42j8m?workspaceId=4a3e8946-02ff-4af1-aeb6-deeb01d9e58a
Additional context
Try running
pnpm run build
in the reproduction and you will see the error. For some reason, the error doesn't occur when using......in tsconfig.json. But that doesn't seem like a viable solution as that causes other module issues and is not really recommended by TS at this point.