-
Notifications
You must be signed in to change notification settings - Fork 57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"Ambiguous match found" error during JSON serialization for Fable.Remoting.Json > 2.16.0 #268
Comments
Hi @ArtemyB I haven't seen this error before 🤔 maybe if you can share the return types that are failing, I could also take a look there? |
Just to make sure, can you check if using the latest v2.19.0 of Fable.Remoting.Json solves this issue? |
@Zaid-Ajaj sorry for the answer delay: posted the issue and went away from the PC :) But now I'm back and already have tried the recent Fable.Remoting.Json v2.19.0 -- no success, still get the error. However I've looked through the data being serialized in my error-prone Remoting-function and have noticed a pattern: all error-returning calls contain at least one value that looks like |
Hmm, there is also a value of type like |
Probably Option with DU is not the reason -- one other field of the same record also has type |
Hi @ArtemyB I am looking at the issue again and I am able to reproduce the problem :/ any chance you could post an exact type of the API (and the all the types used in it) so that I can debug it? Creating a full sample repository to demonstrate the problem would be really helpful for me as well |
@Zaid-Ajaj hi. Understood, I'll revisit the project on this weekend and extract problematic fragment to a separate sample. |
P.S.: Only a guess: my problem could be connected with PR #254 (don't know how exactly -- simply it looks like the major update between Fable.Remoting.Json v2.16.0 and v2.17.0; + it affects unions and other types serialization) |
Hi @ArtemyB is this still an issue for you from the latest versions? If so, please consider posting a sample project that I can test with |
Hi @Zaid-Ajaj error still there, I have a repro https://github.com/brud/safe-stack-remoting-issue-repro |
@Zaid-Ajaj should I create a new issue for that? |
@Zaid-Ajaj I apologize fo such a huge delay, but I simply haven't touched that troubled project, leaving it on the old version of Fable.Remoting. And extracting repro from it required quite a lot of work (the project was kind of a mess), so I simply couldn't get a time and energy to do that. However now, thanks to @brud and his repro, error's reason is finally revealed: both @brud's and my data has a DU with a case named Note that I just tested on the recent |
Recently after updating my project dependencies to the latest
Fable.Remoting.Giraffe
v5.4.0 (which requiresFable.Remoting.Json >= 2.18.0
) one of the API function in my Fable.Remoting handler started throwing an error "Ambiguous match found" in some cases. After a quick glance I haven't discovered any obvious pattern (had no time to look thoroughly). So more attentive search is required, because the error occurs only for some instances of the return type (i.e. in some cases the same API function succeeds and in other cases it fails) -- I'll explore this later. But judging by the stack trace I suspect it is related to unions serialization.At the same time there is no error when I use
Fable.Remoting.Json 2.16.0
(requires at leastFable.Remoting.Giraffe 5.7.0-rc-6
andFable.Remoting.Server 5.21.0
).The exception stack trace:
The text was updated successfully, but these errors were encountered: