Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RefShared DOMException error if data contains array #1034

Open
johnrossporter opened this issue Oct 14, 2022 · 0 comments
Open

RefShared DOMException error if data contains array #1034

johnrossporter opened this issue Oct 14, 2022 · 0 comments

Comments

@johnrossporter
Copy link

When using refShared and modifying data, I am getting the following error in browser console:

Uncaught (in promise) DOMException: Failed to execute 'postMessage' on 'BroadcastChannel': [object Array] could not be cloned. at send (http://127.0.0.1:5173/node_modules/.vite/deps/vue-composable.js?v=feda6e83:1262:22) at watch.deep (http://127.0.0.1:5173/node_modules/.vite/deps/vue-composable.js?v=feda6e83:1821:5) at callWithErrorHandling (http://127.0.0.1:5173/node_modules/.vite/deps/chunk-BX7HPCYS.js?v=86b71d6a:1373:18) at callWithAsyncErrorHandling (http://127.0.0.1:5173/node_modules/.vite/deps/chunk-BX7HPCYS.js?v=86b71d6a:1381:17) at job (http://127.0.0.1:5173/node_modules/.vite/deps/chunk-BX7HPCYS.js?v=86b71d6a:2643:9) at callWithErrorHandling (http://127.0.0.1:5173/node_modules/.vite/deps/chunk-BX7HPCYS.js?v=86b71d6a:1373:32) at flushJobs (http://127.0.0.1:5173/node_modules/.vite/deps/chunk-BX7HPCYS.js?v=86b71d6a:1560:9)

This error usually happens when data contains non-serializable elements such as functions, but I think my data should be okay.

const shared = refShared({arr:[1,2,3]}, "test"); return { shared }

The exception happens when I modify it as such
this.shared.arr = [4,5,6]

Note that this error only seems to occur with my array. If I have a string or a number it works fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant