Cannot access logged object properties from remote console.log (Console Agent) (Live preview) #13030

Open
Worie opened this Issue Jan 10, 2017 · 0 comments

Projects

None yet

1 participant

@Worie
Worie commented Jan 10, 2017 edited

Prerequisites

  • Can you reproduce the problem with Debug -> Reload Without Extensions?
  • Did you perform a cursory search to see if your bug or enhancement is already reported?
  • Did you read the Troubleshooting guide?

Description

When logging an JS object via console, we can't access the properties/values/methods of it, instead we just get string represantation as [Object object].

Steps to Reproduce

  1. Launch Live Preview.
  2. Log an object to the console (console.log({foo: "bar"}))
  3. Open brackets console (not the browser one, so the Live Dev session is still alive.
  4. You can see that Console Agent logs it to Brackets Console, but we cant see what is actually inside of this object (we get [Object object], and can't read property foo of it of course)

Expected behavior: Ability to log the variables to the console, which allows reading the properties of a object and etc. I wonder, if there are any extenstions that allow to do so (havn't found any).

Actual behavior: [Object object] is returned. I guess it is due to implementation of Chrome Debbuging Protocol (wild guess) and I'm not sure if there's a simple fix for that. The only workaround I've found so far is to call JSON.serialize on the object before placing it inside console.log method.

Versions

OSX Sierra 10.12.1 (16B2555)
Brackets 1.8

@Worie Worie changed the title from Cannot access logged object properties from remote console.log (Console Agent) to Cannot access logged object properties from remote console.log (Console Agent) (Live preview) Jan 10, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment