Closed matthme closed 9 months ago
It's maybe debatable whether the workaround for this should be placed in the js-client but it seems like a negligible change to add it in that place and makes life easier for implementors of host zome call signers because it's quite unexpected to get a proxy object in the zome call request.
I'm fine with merging that, sure. Can you show an example in Vue where that falls over?
Yes - you can run the hc scaffold example forum
(the holochain 0.1 version of it) with Vue as framework and then you will see that zome calls throw the error Error: An object could not be cloned.
. This is electron that's complaining because it can't serialize the cell_id since it's not an actual javascript object but a Vue proxy object. The latter you can see if you log the cell_id here in the js-client.
I can not confirm that. I just created a new forum app with Vue, ran npm install and start and it works fine
It would be surprising if this hasn't been working all along. Can you doublecheck if this happens for you on a freshly scaffolded project?
Oh sorry, my instructions were not correct. I forgot that I ran it with the scaffolding from this PR. So you'd need to use hc-spin to start the app instead of hc-launch since in the hc-launch case the js-client does some conversions of the zome call request object before sending it over IPC to the tauri backend.
Or in your existing project:
npm install --save-dev @holochain/hc-spin@">=0.100.0 <0.200.0"
and then modify the launch:happ
script to:
"launch:happ": "hc-spin -n $AGENTS --ui-port $UI_PORT workdir/forum.happ",
released as v0.12.8
Adds a workaround for the case where the
AppAgentClient
is used as a proxy object in Vue and therefore thecell_id
is passed as a proxy object to callZome instead of a normal javascript array.