hello everyone !
i am trying to call async function using ws.eval() with JServer3 Websocket handler;
but show this error :
B4X:
VM1668:3 Uncaught SyntaxError: await is only valid in async functions and the top level bodies of modules
at new Function (<anonymous>)
at b4j_eval (b4j_ws.js:55:13)
at b4j_ws.onmessage (b4j_ws.js:87:13)
at HTMLDivElement.<anonymous> (reconnecting-websocket.js:182:75)
at ws.onmessage (reconnecting-websocket.js:282:29)
You can not use async methods with ws.eval. You will have to rewrite the method as a classic promise with .then() and raise an event. Without seeing the original javascript it is impossible to help you with doing that.