Closed Unity-G closed 3 years ago
I am using "serializr": "2.0.3"
Using something as: ` class MyClass { @serializable Data: string;
static toString(myObj: MyClass): string { debugger; }
} `
Calling serialize(MyClass, new MyClass()); will call "toString";
serialize(MyClass, new MyClass());
Due to: 415:serialir.js invariant(foundSchema, "Failed to find default schema for " + modelSchemaOrInstance);
invariant(foundSchema, "Failed to find default schema for " + modelSchemaOrInstance);
Having "+ modelSchemaOrInstance" will call the static toString of the modelSchemaOrInstance.
Fix: 415:serialir.js invariant(foundSchema, "Failed to find default schema for " + modelSchemaOrInstance.name);
invariant(foundSchema, "Failed to find default schema for " + modelSchemaOrInstance.name);
Hope it helps
I am using "serializr": "2.0.3"
Using something as: ` class MyClass { @serializable Data: string;
} `
Calling
serialize(MyClass, new MyClass());
will call "toString";Due to: 415:serialir.js
invariant(foundSchema, "Failed to find default schema for " + modelSchemaOrInstance);
Having "+ modelSchemaOrInstance" will call the static toString of the modelSchemaOrInstance.
Fix: 415:serialir.js
invariant(foundSchema, "Failed to find default schema for " + modelSchemaOrInstance.name);
Hope it helps