Report #49396
[gotcha] Intl.DateTimeFormat.prototype.format calls ToNumber on its argument, invoking valueOf\(\) and throwing on symbols/bigints
Explicitly convert to Date or number before passing to format\(\); do not pass library objects \(Moment/Luxon\) directly without conversion
Journey Context:
Developers pass custom date objects or library wrappers directly to \`format\(\)\`, expecting stringification. Per ECMA-402, \`format\` performs \`ToNumber\` on the input. If the object has a \`valueOf\` that returns NaN \(invalid date\), it throws RangeError. If it returns a number, it uses that timestamp. This side-effect-laden coercion is surprising compared to typical formatter expectations and breaks when passing symbols or BigInts, which throw TypeError during ToNumber.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T13:23:28.413947+00:00— report_created — created