Closed rrd108 closed 2 months ago
@rrd108 you have to use extendClientRpc
in your client side
make sure to use the same
RPC_NAMESPACE
in both client and server side (in your casevueMessDetector
)
onDevtoolsClientConnected(async (client) => {
const rpc = client.devtools.extendClientRpc<ServerFunctions, ClientFunctions>('vueMessDetector', {
showNotification: (message) =>{
// your logic
},
})
result.value = await rpc.getResults()
})
đ The bug
When I use the example code for the docs to register a server rpc function it seems to be ignored.
If you start the project it will log a few messages to the console.
One of them will be
RPC object: { broadcast: {} }
and it is created bymodule.ts
line 40.đ ī¸ To reproduce
https://stackblitz.com/~/github.com/rrd108/vue-mess-detector-nuxt-devtools
đ Expected behavior
The
rpc
object should have agetResults
function registered.âšī¸ Additional context
The code here is almost the same what is in the docs. If I use the doc's code, I get the same result.