schema icon indicating copy to clipboard operation
schema copied to clipboard

[Bug]: better error message when trying to use nested maps of maps, maps of arrays, etc

Open endel opened this issue 1 month ago • 0 comments

When user tries to define nested complex types, like this:

@type({ map: { map: "number" } })
playerScores = new MapSchema<MapSchema<number>>();

@type({ map: { array: "string" } })
playerTags = new MapSchema<ArraySchema<string>>();

The server crashes with the following error:

TypeError: Cannot read properties of null (reading 'Symbol(Symbol.metadata)')

This error is not very helpful. We need to make it more explicit this feature is not supported at the moment.

endel avatar Nov 26 '25 02:11 endel