Closed boneskull closed 3 months ago
Nevermind; I don't think it has to do with the type guard helpers. The workaround doesn't always work. 😄
I'll open a new issue if I figure out what's going on.
I can confirm it starts being a problem at a0e9ebcef26552659ac6c2c785c138387eafc766
Ref: #5048
XState version
XState version 5
Description
5009 / 5.17.1 seems to befoul something related to guard helpers (
and
,not
, etc.). On some machines using guard helpers, I see:This error is not present in 5.17.0.
Expected result
No type error
Actual result
Type error
Reproduction
n/a
Additional context
I don't have a reasonable reproduction yet; this does not affect every machine using the helpers and seems like an edge case. It might only happen once some threshold of machine complexity is reached.
Speculating: the type arguments for the helpers are too wide; e.g.:
It may be it should look more like:
WORKAROUND: This error goes away by removing use of guard helpers (
and
,not
,or
, etc.) from affected machines.