xstate icon indicating copy to clipboard operation
xstate copied to clipboard

Bug: App will crash if sending DOM ref to machine and using inspect

Open KKzLEO opened this issue 2 years ago • 1 comments

Description

Sending event with DOM ref as data will crash the app entirely, but only happened if you're using @xstate/inspect.

Expected result

Don't crash

Actual result

crash the entire app. the error message is from React.

TypeError
Cannot set properties of undefined (setting 'pendingProps')

Reproduction

https://codesandbox.io/s/beautiful-dhawan-85g5so?file=/src/index.js:927-931

Clicking click me button will crash the app, the errorr message from React will show up.

Additional context

No response

KKzLEO avatar Jul 28 '22 19:07 KKzLEO

You are using some old versions of our libraries in this codesandbox. I've upgraded it and added a custom serialize option to the inspect call that makes it possible to handle DOM nodes: https://codesandbox.io/s/gracious-mendeleev-9uyz61?file=/src/index.js

Andarist avatar Jul 29 '22 10:07 Andarist