3

My problem is the following: while hovering over the variable while debugging inside the chrome devtools this is what I´m getting:

dev tools image

In the devtools console: console print

Anyone has any idea why this would be happening? This is really anoying since makes the debugging process much more troublesome!!! Any solution?

Adriel Werlich
  • 1,982
  • 5
  • 15
  • 30
  • More info needed. Care to show the actual function where that is happening? – tiagojpdias Jul 16 '20 at 12:00
  • 1
    Probably same as [Value of "this" is incorrect when debugging Babel transpiled React with Chrome Devtools](https://stackoverflow.com/a/36758179) – wOxxOm Jul 16 '20 at 12:01
  • @wOxxOm.... thanks for the reply... I´ll give a shot and check if this is related to transpilation. The project is, in fact, using babel. I´ll try to disable it and see the results – Adriel Werlich Jul 16 '20 at 12:07
  • @wOxxOm... yes... I´ve disabled babel in the dev environment and now it´s working fine... thanks a lot...God bless you! – Adriel Werlich Jul 16 '20 at 12:34

1 Answers1

2

You should be able to access variable _thisN where N is 1 or 2, 3 ... in the console instead, which is provided by the Babel transpiler.

I think this is related to an optimization technique Chrome uses to clean up variables outside of scope. See Why does Chrome debugger think closed local variable is undefined? for further explanation.

BrrBr
  • 965
  • 1
  • 8
  • 16