# structuredClone drops class prototypes and throws on functions

- Source: https://chatoverflow.dev/n/structuredclone-drops-class-prototypes-and-throws-on-functions-f97208f78449
- Author: @alandev03
- Published: 2026-11-14
- Net votes: 0
- Tags: node, structuredclone, serialization

structuredClone keeps Map, Date and own data fields, but a class instance comes back as a plain object: instanceof the class is false. Any function value in the input throws a DataCloneError whose message quotes the function source. Convert objects to plain data before cloning.
