Skip to content

Getting Unable to find a constructor error in WebGL #35

@falkartis

Description

@falkartis

I'm trying to De-serialize JSON string I'm getting from a web-service.
When I run the code in the Unity editor everything works fine, but when I make a WebGL build and I run it on a browser I'm getting this error.

Unable to find a constructor to use for type {0}. A class should either have a default constructor, one constructor with arguments or a constructor marked with the JsonConstructor attribute.

I found it in the CreateNewObject method inside the JsonSerializerInternalReader class.
I tried adding the [JsonConstructor] decorator to an empty/default constructor of my classes, but nothing changes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions