38

ERROR Error: "[object Object]"

How is THAT supposed to be helpful?

Comments
  • 6
    JS in general is not a very helpful language... one if the worst regarding debugging.
    And no, with debugging I don‘t mean putting console.log on every second line ...
  • 2
    @mojo2012 Right! Been there done that ... reminds me of the early days in Assembler or something. No debuggers, etc. You'd think we'd come further by now!
  • 3
    @jgwinner every year or so I gove JS a try. The last couple if months I was playing around with react-admin and vue-storefront.
    And every year again I wonder how JS devs manage to stay sane somehow.

    Debugging a react babel redux webpack app? Umm well good luck mister. Better stop and shot yourself in the foot...
  • 2
    @mojo2012 I shot both my feet off, now where do I continue
  • 8
    It's probably your own console log. Try console.log("Error: ", errorObject) or console.log("Error: " + JSON.stringify(errorObject));

    (Or console.error)

    That you don't fully understand a language doesn't mean it sucks.

    And about the debugging part, in vscode for example you can debug javascript and nodejs.
  • 1
    @karma 😂 why both? Did u have to use go too?
  • 2
    @Jifuna yeah, I know. But uf you are used to what debugging mean (debugging into conpiled code from anywhere, breakpoints just working, instead of being randomly ignored, sourcecode that is bust always properly aligned to the debugger) ur f...d with JS
  • 6
    @mojo2012 Hmm, I don't know never had any problems with debugging node in vscode.
  • 1
    @Jifuna then ur lucky, or ur just used to how it works and therefore cant compare it to superior solutions. Happens to me all the time, talking to people who never had a problem and then I see how the actually debug, lie with sticks n stoned like in the stone age unable to see how it could be done better
  • 5
    @mojo2012 Just like Jifuna I've never had any of those problems in either VSCodes or the browsers debugger.
  • 5
    @mojo2012 So, you fail at stuff and the rest are retrograde morons? Cool.
  • 0
    @telephantasm so please enlighten me. Checkout vie-storefront and debug into the gzip compression library.

    Because it failed me with a EOF stream exception on a rest endpoint, worked in the browser though.

    No useful logging, no hints, no breakpoints out if the box, bc vscode typescript babel wepback kinda screwed all up.

    If you can show me how u can do this, I‘d be very thankful.
    And btw it should work wothout modifying any of the dependencies, just with a click on the breakpoint sidebar in any sourcefile.

    Thanks in advance
  • 0
    @inaba i was NOT talking about debugging ur own code 🙄
  • 2
    @Jifuna or console.dir

    console.dir let's you view the object tree inside the browser console, rather than all the mess at once. Sure you can always use JSON.Stringify
  • 0
    @inaba so show me how u even find the proper line if code in a webpack babel perverted sourcfile of a dependency (in a browser)
  • 0
    @mojo2012 How do you find the "proper line if code" in a disassembled 6502 binary? Or how about just an ordinary binary?

    Of course if you have to debug other peoples compiled or transpiled code without labelfiles or sourcemaps it's going to be difficult.
  • 0
    @mojo2012 I tried it ... worked on my feet
  • 0
    @inaba In java you can set a breakpoint in any compiled or not compiled library class. It doesnt matter what settings, toolchsin, buildtool, deployment artifactory the author chose.
    In theory you can chose to not create debug symbols (like source maps in java), but in 15 y of java i only had that once ir twice. Whereas with JS this is the regular case. You have to customize and tweak every frigging project and still it feels so subpar.
  • 0
    @mojo2012 So true! It's a mess.
Add Comment