ambiorix icon indicating copy to clipboard operation
ambiorix copied to clipboard

error when trying to use custom websocket handler function

Open merlinoa opened this issue 1 year ago • 0 comments

When trying to specify my own websocket handler function:

app$websocket <- \(ws){
  ws$onMessage(\(binary, message){
    cat("Received a message:", message, "\n")
  })
}

I get the following error:

Error in app$websocket <- function(ws) { : 
  cannot add bindings to a locked environment

I am following the documentation here:

https://ambiorix.dev/docs/ambiorix/websocket#bypass-ambiorix

I think this "websocket" field needs to be defined in the app or router, but I am not sure as I am not very familiar with websockets. Sorry if I am missing something obvious here.

merlinoa avatar Feb 14 '24 16:02 merlinoa