Zaid-Ajaj / Fable.Remoting

Type-safe communication layer (RPC-style) for F# featuring Fable and .NET Apps
https://zaid-ajaj.github.io/Fable.Remoting/
MIT License
273 stars 55 forks source link

Invalid cast invoking function "Map<int * int,int> -> Async<bool>" #145

Closed markCompostional closed 4 years ago

markCompostional commented 4 years ago

See

https://github.com/markCompostional/ElmishRemotingMapIssue

description of issue, code and instruction of how to reproduce there.

server reports

info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] Request starting HTTP/1.1 POST http://localhost:8085/api/ICounterApi/setMap application/json; charset=UTF-8 13 System.InvalidCastException: Cannot cast Newtonsoft.Json.Linq.JArray to Newtonsoft.Json.Linq.JToken. at Newtonsoft.Json.Linq.Extensions.Convert[T,U](T token) at Fable.Remoting.Server.DynamicRecord.createArgsFromJson$cont@132-1(RecordFunctionInfo func, FSharpOption1 logger, Type input, JToken parsedJson, Unit unitVar) at Fable.Remoting.Server.DynamicRecord.tryCreateArgsFromJson(RecordFunctionInfo func, String inputJson, FSharpOption1 logger)

Zaid-Ajaj commented 4 years ago

Hello @markCompostional, thanks a lot for the detailed issue and for the repository to reproduce the problem, I will look into it ASAP :smile:

markCompostional commented 4 years ago

I’ve got a workaround using just list, so no panic.

Sent from Mailhttps://go.microsoft.com/fwlink/?LinkId=550986 for Windows 10


From: Zaid Ajaj notifications@github.com Sent: Friday, November 15, 2019 12:38:55 PM To: Zaid-Ajaj/Fable.Remoting Fable.Remoting@noreply.github.com Cc: Mark Nicholls mark@compositional-it.com; Mention mention@noreply.github.com Subject: Re: [Zaid-Ajaj/Fable.Remoting] Invalid cast invoking function "Map<int * int,int> -> Async" (#145)

Hello @markCompostionalhttps://github.com/markCompostional, thanks a lot for the detailed issue and for the repository to reproduce the problem, I will look into it ASAP 😄

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/Zaid-Ajaj/Fable.Remoting/issues/145?email_source=notifications&email_token=ANY6ZRMVKKP47DMTEGLLUG3QT2J57A5CNFSM4JN2FXB2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEEFJ6ZQ#issuecomment-554344294, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ANY6ZRMAIGIKREJEAEABQRTQT2J57ANCNFSM4JN2FXBQ.

Zaid-Ajaj commented 4 years ago

Hello @markCompostional, this should be fixed if you update your Giraffe adapter from v3.10.0 -> v3.11.0

paket update Fable.Remoting.Giraffe --group Server

I tried it in the repro you posted and no errors occur, can you confirm? Please re-open the issue if the problem persists :smile:

markCompostional commented 4 years ago

Let me try

Sent from Mailhttps://go.microsoft.com/fwlink/?LinkId=550986 for Windows 10


From: Zaid Ajaj notifications@github.com Sent: Friday, November 15, 2019 2:41:56 PM To: Zaid-Ajaj/Fable.Remoting Fable.Remoting@noreply.github.com Cc: Mark Nicholls mark@compositional-it.com; Mention mention@noreply.github.com Subject: Re: [Zaid-Ajaj/Fable.Remoting] Invalid cast invoking function "Map<int * int,int> -> Async" (#145)

Hello @markCompostionalhttps://github.com/markCompostional, this should be fixed if you update your Giraffe adapter from v3.10.0 -> v3.11.0

paket update Fable.Remoting.Giraffe --group Server

I tried it in the repro you posted and no errors occur, can you confirm? Please re-open the issue if the problem persists 😄

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/Zaid-Ajaj/Fable.Remoting/issues/145?email_source=notifications&email_token=ANY6ZRNUCCBVY3HCNHDFB5LQT2YLJA5CNFSM4JN2FXB2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEEFT3UQ#issuecomment-554384850, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ANY6ZROHYMLIDKALO5IW2ILQT2YLJANCNFSM4JN2FXBQ.

markCompostional commented 4 years ago

Works for me!

Sent from Mailhttps://go.microsoft.com/fwlink/?LinkId=550986 for Windows 10


From: Zaid Ajaj notifications@github.com Sent: Friday, November 15, 2019 2:41:56 PM To: Zaid-Ajaj/Fable.Remoting Fable.Remoting@noreply.github.com Cc: Mark Nicholls mark@compositional-it.com; Mention mention@noreply.github.com Subject: Re: [Zaid-Ajaj/Fable.Remoting] Invalid cast invoking function "Map<int * int,int> -> Async" (#145)

Hello @markCompostionalhttps://github.com/markCompostional, this should be fixed if you update your Giraffe adapter from v3.10.0 -> v3.11.0

paket update Fable.Remoting.Giraffe --group Server

I tried it in the repro you posted and no errors occur, can you confirm? Please re-open the issue if the problem persists 😄

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/Zaid-Ajaj/Fable.Remoting/issues/145?email_source=notifications&email_token=ANY6ZRNUCCBVY3HCNHDFB5LQT2YLJA5CNFSM4JN2FXB2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEEFT3UQ#issuecomment-554384850, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ANY6ZROHYMLIDKALO5IW2ILQT2YLJANCNFSM4JN2FXBQ.

Zaid-Ajaj commented 4 years ago

Awesome 🎉 thanks for confirming