Websharper makes an asynchronous call return server error 500
I am trying to do async db query using SQLProvider and sqlite as db. The server side function looks like this:
[Rpc]
let dbAsyncCall () =
async {
return! query {
// ...
} |> Seq.executeQueryAsync
}
|> Async.StartAsTask
|> Async.AwaitTask
On the client side, I call it like this
async {
let! data = Server.dbAsyncCall ()
// ...
} |> Doc.Async
When the code runs, I get the following error:
What's happening?
Thank!
UPDATE:
Ok, it looks like the problem is with the execution of queries in sqlite. I mean, if I try to do a simple async operation async { return 5}
, it starts without any problem, but when I execute any db related requests and surround them with async
, I get the error. I know the SQLProvider supports asynchronous queries, maybe the problem is with the sqlite lib itself?
UPDATE 2:
source to share
Yes, I got the same error when trying to use SQLite when called from the server side
System.Exception: Could not load method (act : unit -> Microsoft.FSharp.Control.FSharpAsync`1<unit>) candidates: [||]
Look at my mistake in a different, newer aspect. How to use SQLite when building web pages with Websharper or Suave?
source to share