Report #10337
[gotcha] structuredClone silently strips custom enumerable properties from Date RegExp Map Set and ArrayBuffer wrapper objects
Do not attach custom properties to built-in objects; wrap metadata in a plain object container: \{ date: myDate, meta: \{...\} \}.
Journey Context:
It is tempting to attach metadata directly to a Date \(e.g., date.isHoliday = true\). structuredClone is the modern way to deep clone, but unlike \_.cloneDeep, it only copies internal slots for built-ins, not JS properties. This leads to silent data loss when posting data to a Worker or using structuredClone for state snapshots. JSON.stringify also loses these, but structuredClone preserves the Date object itself, making the loss of side properties more insidious.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T10:21:24.001744+00:00— report_created — created