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

Error serializing unrecognized object [object Object] #28

Open
gajus opened this issue Sep 13, 2016 · 5 comments
Open

Error serializing unrecognized object [object Object] #28

gajus opened this issue Sep 13, 2016 · 5 comments

Comments

@gajus
Copy link

gajus commented Sep 13, 2016

I am getting an error:

error Error: Error serializing unrecognized object [object Object]

Here is the JSON input:

https://gist.github.com/gajus/bdd5b3d8cd0ddce24e762495d9779a75

Here is how I load it:

transit.toJSON(Immutable.fromJS(jsonInput))
@glenjamin
Copy link
Owner

I recommend running this in the debugger and finding out exactly which object it is that is producing that error.

@Griezzly
Copy link

Griezzly commented Sep 26, 2016

I have the same issue. It seems to have problems with ArrayMapNode Objects.
The debuggers output of the object is this one:
Image of Object

@glenjamin
Copy link
Owner

Hrm, you shouldn't really get a raw ArrayMapNode like that - they should be contained inside an actual Map.

Can you share a code sample which reproduces this problem please?

@Griezzly
Copy link

Thats a bit more complicated. Im basically using ReactJS with Redux to store the state of my application in an immutable map. Problem is that a lot of that happens in the background and i havent completely figured it out myself how exactly the objects look after creating them since they are created by a libary. But basically its this issue:
rt2zz/redux-persist-transform-immutable#13

I will investigate a bit further

@sebastientromp
Copy link

I'm also facing this exception when serializing a simple javascript object:

[
    {
        "id": "hero-selection",
        "name": "Hero Selection",
        "panels": [
            {
                "id": "bgs-hero-selection-overview",
                "name": "Hero Selection",
                "heroOverview": []
            }
        ]
    },
    {
        "id": "in-game",
        "name": "In Game",
        "panels": [
            {
                "id": "bgs-next-opponent-overview",
                "name": "Next opponent",
                "opponentOverview": null
            }
        ]
    },
    {
        "id": "post-match",
        "name": "Post-match stats",
        "panels": [
            {
                "id": "bgs-post-match-stats",
                "name": "Post-match stats",
                "stats": null
            }
        ]
    }
]

The error is

Error serializing unrecognized object [object Object]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants