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
Define a component with a prop of type function or with a prop of type object.
When using the object type, one property of that object should be a function.
That same component should have an onclick listener, which either calls the function prop or the function property of the object prop.
Inside a story use that same component and define a ref and a function in the script tag.
The function should change the ref's content.
Pass that same function as prop to the earlier defined component, again either for the function prop or the object prop.
Click the component, so the event listener gets triggered, which should call your defined function and change the ref's contents.
The function seems to be executed but you will immediately see an error pop up in your console:
Uncaught (in promise) DOMException: Failed to execute 'postMessage' on 'Window': function updateState() {
state.value = true
} could not be cloned.
When you do not touch any state inside the function no error occurs. So for example if you only log something to the console or trigger an alert.
Describe the bug
Define a component with a prop of type function or with a prop of type object.
When using the object type, one property of that object should be a function.
That same component should have an onclick listener, which either calls the function prop or the function property of the object prop.
Inside a story use that same component and define a ref and a function in the script tag.
The function should change the ref's content.
Pass that same function as prop to the earlier defined component, again either for the function prop or the object prop.
Click the component, so the event listener gets triggered, which should call your defined function and change the ref's contents.
The function seems to be executed but you will immediately see an error pop up in your console:
Uncaught (in promise) DOMException: Failed to execute 'postMessage' on 'Window': function updateState() {
state.value = true
} could not be cloned.
When you do not touch any state inside the function no error occurs. So for example if you only log something to the console or trigger an alert.
Is this related to not using an iframe for the story rendering, which is mentioned here: https://histoire.dev/examples/vue3/single-stories.html#integrated ?
Reproduction
https://stackblitz.com/edit/histoire-vue3-starter-4nrxsf?file=src%2FBaseButton.vue,src%2FBaseButton.story.vue
System Info
Used Package Manager
npm
Validations
The text was updated successfully, but these errors were encountered: