Skip to content
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

DeserializeLambda: Type not supported #524

Open
fjoppe opened this issue Feb 5, 2016 · 5 comments
Open

DeserializeLambda: Type not supported #524

fjoppe opened this issue Feb 5, 2016 · 5 comments
Labels
Milestone

Comments

@fjoppe
Copy link

fjoppe commented Feb 5, 2016

Hi,
I am trying to do something with Websocket, and for this I need Websharper.Json, and especially the serialize/deserialize functions.

I have an akka.net actor-system which orchestrates state, and this system has some messages. I wanted to reuse these messages, to be send through the Websocket, and therefore I tried to make them Websharper.Json ready with attribute [<NamedUnionCases>].

So I have two aggregate DU's, the source is here. "PlayerMessage" is send from client to actor system. "PlayerMessageResponse" is send from actor system to client.

So for, so good.

One of the cases in "PlayerMessageResponse" gives problems. When I compile (not the library, but the ws application using the library) gives the following compilation error:

Error GameEngine.Common.PlayerMessageResponse: DeserializeLambda: Type not supported: GameEngine.Common.TileType GameUI.Suave F:....\WebSharper.3.6.7.227\build\WebSharper.targets 60

Detail, the library containing "PlayerMessageResponse" was first an ordinary library, but I added a property to the project as explained here. This fixed the previous problem that no DU was compiling at all. So now its reduced to "TileType".

The source of TileType is found here. Decorated with an attribute or not; it does not compile.

My suspicion is that this DU is different because it actualy is an enumeration and I assign constants to it. Still, I'm stuck here, so I suspect a defect.

@Tarmil
Copy link
Member

Tarmil commented Feb 6, 2016

Yes this seems to be an issue with enumerations, I'm investigating.

@Tarmil Tarmil closed this as completed in 57d9cf0 Feb 6, 2016
@granicz granicz added this to the 3.6.10 milestone Feb 13, 2016
@fjoppe
Copy link
Author

fjoppe commented Feb 20, 2016

Hi,

I just upgraded to WS 3.6.10.230. I don't know what to expect, but this issue is still in there.

@granicz
Copy link
Member

granicz commented Feb 21, 2016

That's no good news, reopening ticket then for Loic to double-check.

@granicz granicz reopened this Feb 21, 2016
@Tarmil
Copy link
Member

Tarmil commented Feb 26, 2016

This is strange. I just added test cases for enum types and they are passing just fine.

@fjoppe
Copy link
Author

fjoppe commented Feb 27, 2016

I still see the issue. However I have a suspect. I get this error in a Websharper.Suave (3.6.4.30) project, but a Websharper C/S project which includes the same dll, does not provide this error.

The WS.Suave project gets a list of other packages from nuget, including Fsharp.Core 3.1.2.5. In coïncidence with a propriaty project at work this week, I discovered that different Fsharp.Core's can influence how WS works. I found that Fsharp.Data and WS, in sepearte dll-projects, were not working together very well, until I used Fsharp.Core 4.4.0.0 in both projects.

So the Fsharp.Core is my prime suspect. As I'm turning away from the idea of using a Websocket in a Websharper.Suave project, due to complications, maybe its good to reconsider if you want to fix this, for this type of situation.

@Tarmil Tarmil added the bug label Mar 18, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants