OMG, I thought your problem is the same with me but it's not.
The problem is just caused by that you return nothing
when re-define the function.
Here is your original code block:
descriptor.value = function (...args:any[]) { //before console.log(`${key} method called with args: ${JSON.stringify(args)}`); let result = originalMethod.apply(this, args); //after console.log(`${key} method return value: ${JSON.stringify(result)}`); }
Now, return it and it will work correctly.
descriptor.value = function (...args:any[]) { //... let result = originalMethod.apply(this, args); //... return result; //ADD HERE!!! }