Version
24.11.1
Platform
Darwin Mac.fritz.box 24.6.0 Darwin Kernel Version 24.6.0: Mon Jul 14 11:28:30 PDT 2025; root:xnu-11417.140.69~1/RELEASE_ARM64_T6030 arm64
Subsystem
No response
What steps will reproduce the bug?
console.log(
new Proxy(new Error(), {
get(target, key, receiver) {
// Need to return `target.stack` instead of `Reflect.get` starting with Node.js v21.0.0
// when trying to get the `stack`.
return Reflect.get(target, key, receiver);
},
}).stack
);
How often does it reproduce? Is there a required condition?
always
What is the expected behavior? Why is that the expected behavior?
A stacktrace is logged. Reflect.get is supposed to be equivalent to target[propertyKey]
What do you see instead?
undefined is logged.
Additional information
Started with Node.js v21.0.0. Once I return target.stack from the Proxy getter, a stack is returned as usual. Reflect.get(error, 'stack', receiver) just doesn't work. Though it does work with Reflect.get(error, 'stack')
Version
24.11.1
Platform
Subsystem
No response
What steps will reproduce the bug?
How often does it reproduce? Is there a required condition?
always
What is the expected behavior? Why is that the expected behavior?
A stacktrace is logged.
Reflect.getis supposed to be equivalent totarget[propertyKey]What do you see instead?
undefinedis logged.Additional information
Started with Node.js v21.0.0. Once I return
target.stackfrom the Proxy getter, a stack is returned as usual.Reflect.get(error, 'stack', receiver)just doesn't work. Though it does work withReflect.get(error, 'stack')