Report #10343
[gotcha] Proxy get trap throws TypeError when returning different value for non-writable non-configurable property on target
In get traps, always return Reflect.get\(target, prop\) for frozen/sealed objects; use a revocable proxy or wrapper pattern to avoid invariant violations.
Journey Context:
When creating mocking utilities or defensive proxies, developers override the get trap to return synthetic values: get: \(\) => 'fake'. If the target is frozen \(e.g., a class instance or Object.freezed object\), the Proxy invariants require that the trap return the actual stored value for non-writable, non-configurable properties. Violating this throws a TypeError. This is a hard crash in defensive programming scenarios. The fix is to check the property descriptor on the target and defer to Reflect.get for frozen properties, or avoid wrapping frozen objects.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T10:22:23.633617+00:00— report_created — created