question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Deserialization works in program but fails in interactive

See original GitHub issue

I’ve found a strange issue where deserialization of a type works fine in my program, but fails when I run the same serialization in interactive. In interactive I get the following exception:

Couldn't parse config, error=JSON Path: . Failed to serialize, must be one of following types: record, map, array, list, tuple, union. Type is: Configuration.

I haven’t been able to create a minimal example of the issue, but I’ve made a branch on the affected project to demonstrate the issue here.

To see the issue:

  1. Place a debug breakpoint here. This is where we try to parse the Configuration type.
  2. Run the Lint project test. This will try to lint the provided project, eventually hitting the parseConfig breakpoint above, when it tries to parse the default configuration file. It should succeed.
  3. Run the FSharp.Json.Error.fsx file in interactive debug. You should get the exception above, when it tries to parse the same default configuration.

Through this I was able to confirm that the two functions seem to be receiving the same input.

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:17 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
vincenzomlcommented, Feb 20, 2020

Hi all, I had this issue today, and it was caused by the fact that I had made “private” the type I was trying to parse from json. Removing “private” solved the issue. So maybe the exception is caused by an accessibility problem?

0reactions
NicoVIIIcommented, Jun 2, 2020

If there is no way (for now?) to fix this issue, I guess a better exception message which points to the real problem would be nice. I was confused, when the thrown exception told me, that my record type is not a record type 😄

Read more comments on GitHub >

github_iconTop Results From Across the Web

Deserialization works in program but fails in interactive #25
I've found a strange issue where deserialization of a type works fine in my program, but fails when I run the same serialization...
Read more >
Deserializes from file working but not blob? - ...
The problem lies when trying to deserialize an instance of the class itemSet returned in a resultSet after querying my database. The blobfile ......
Read more >
Issue while using Deserialize activity - Help
The api was updated and it doesn't work anymore. (it went from ' to " ). I used to : Deserialize once, to...
Read more >
Data Account Cannot Be Deserialized
The failed deserialization likely means something is up with MessageAccount . Try writing some unit tests to try deserializing it from a slice ......
Read more >
JSON Deserialize (Values are not assigning)
Hey,. I am using JSON Deserialize. I just created the structure based on the output. It automatically created with the following. But the ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found