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
272 stars 54 forks source link

MsgPack invalid casting #235

Closed Shmew closed 3 years ago

Shmew commented 3 years ago

I'm encountering an exception when initializing the .NET MsgPack serializer. I tried finding where this casting is happening, but no luck. The exception on my end is happening here. I'm having trouble properly reproducing the exception as it isn't happening in my actual repo (I tried both updating and downgrading packages with no luck), but is for others. SignalR swallows the exception normally so the reproduction he linked won't reveal it, I had to reference the Fable.SignalR projects directly and run the debugger to find this:

image

If I can do anything else to help please let me know.

kerams commented 3 years ago

Do Details contain the call stack?

kerams commented 3 years ago

Nevermind, it has to be this https://github.com/Zaid-Ajaj/Fable.Remoting/blob/2d88a987d68f69ab4172c8563f3401a40dbe1e4d/Fable.Remoting.MsgPack/Write.fs#L315

And I think I spotted the problem. Action here maybe refers to System.Action rather than the request type (hubContext: FableHub<Action, Response>). Or let invoke (msg: Action) (hubContext: FableHub) = is missing explicit generic type parameters?

Shmew commented 3 years ago

Do Details contain the call stack?

image

image

Shmew commented 3 years ago

As we discussed in the issue on my repo, we have this resolved. @kerams do you want me to leave this open until there's a better error message? If not feel free to close the issue.

Thanks!