Hi all!
I'm currently working on a very large state machine which invokes other complex state machines.
Now the size of the state machine has grown in such a huge size that the Typescript compiler is now complaining about it with the following error:
The inferred type of this node exceeds the maximum length the compiler will serialize. An explicit type annotation is needed.ts(7056)
I had the same bug previously as well with the Context Provider for React, but this one I managed to solve using this bit of code:
export const BookingFlowMachineContext: ReturnType<
typeof createActorContext<typeof bookingFlowMachine>
> = createActorContext(bookingFlowMachine);
However I'm not able to do a solution like it, for my very large state machine, due to it having a cyclical reference.
The state machine in question is the one with the name bookingFlowMachine.
Has anyone else had an issue with this before and found a solution?
Currently if I can't get around the typing issue, I would have to decouple each machine and then send data between them through React instead of directly from machine to machine which just seems cumbersome.
Thanks,
Rob