You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
But not an undefined check, resulting in observed being undefined and then erroring out when observed.element is attempted to be resolved.
As to whyobserved is undefined, I am not sure. I see that it's conditionally initialized in the constructor... although I don't quite understand how that condition could be false.
Description
Occasionally, when tearing down via rive-react's
useRive
hook, we're seeing an error in rive-wasm / canvas:Cannot read properties of undefined (reading 'element')
(see screenshot of stack track below)Provide a Repro
I don't have a repro, but I do have a stacktrace from our Sentry instance:
This clearly shows that
observed
is undefined.Our usage is extremely simple:
Browser & Versions
pnpm -v
: 9.5.0@rive-app/react-canvas 4.15.2
@rive-app/canvas 2.22.0
Additional context
What I believe is happening:
There is a
null
check here:rive-wasm/js/src/rive.ts
Lines 2104 to 2106 in 9138225
But not an
undefined
check, resulting inobserved
beingundefined
and then erroring out whenobserved.element
is attempted to be resolved.As to why
observed
isundefined
, I am not sure. I see that it's conditionally initialized in the constructor... although I don't quite understand how that condition could be false.rive-wasm/js/src/rive.ts
Lines 1564 to 1569 in 9138225
One straightforward fix might simply be initializing it to
null
here (but this does not answer why):rive-wasm/js/src/rive.ts
Lines 1491 to 1492 in 9138225
The text was updated successfully, but these errors were encountered: