Good afternoon,
Witnessing strange behavior today in the browser's developer console when logging objects and arrays from my lightning web component. All objects and arrays are being logged as "Proxy {}", is this consistent for other developers?
Code snippet:
propertyObj = { t1: 'hello', t2: 'world' };
propertyArr = [1, 2, 3, 4];
@track myProxy = { p1: 'test', p2: 44 }; // Should be the only item that is proxied
connectedCallback(){
console.log(this.propertyObj); // Should not be proxied
console.log(this.propertyArr); // Also should not be proxied
console.log(this.myProxy); // Is proxied as expected
// Define object
var obj = {prop1: 'xyz', prop2: 'abc'};
console.log(obj); // Outputs to console as proxy, should NOT be proxied
console.log(JSON.parse(JSON.stringify(obj))); // Useful trick but also does not work to convert from proxy to object
// Define array
var arr = [22, 33, 44];
console.log(arr); // Outputs to console as proxy, should NOT be proxied
}
However, the console will display the actual objects and arrays when "Debug Mode" is enabled for my org's user - this was not necessary before.
Additionally, this same code will not be proxied when it is run on a different org that was created from Trailhead one year ago. Note: Both orgs are on the same Salesforce release and are each on Lightning Locker API version 55.0.
Browser: Chrome
Are you experiencing this behavior on your org as well?
Thanks
Update 2022-09-14
Tested same code in Edge and the items are not proxied (with exception to myProxy, this is expected). This leaves me inclined to believe it is a Chrome issue - my version is 105.0.5195.127 (Official Build) (64-bit).