-
Node.js Version:
v12.18.3
-
OS:
macOS 10.15.6
-
Scope (install, code, runtime, meta, other?):
???
-
Module (and version) (if relevant):
???
New here, and not quite sure the answers to some of the above.
Stepping through my code with node inspect as documented here: https://nodejs.org/docs/latest-v12.x/api/debugger.html
One of the options is:
• watch(expr): Add expression to watch list
Ok, I'm stepping through my code. I'm in the middle of a function called by a constructor function, instantiating/creating an object in a class. There's a bunch of let <variable> = <value> statements. If I go into repl and ask it to tell me the values of those variables (eg. I have one variable di for argument's sake) it reports them correctly. But (outside of repl again) I do watch(di) and it says Uncaught ReferenceError: di is not defined.
I can't imaging this is a bug, or it would have been found and fixed by others long before I came along. Am I using this incorrectly? How do I add a variable or expression to the watch list without getting that not defined error?
I'd appreciate any help. Thanks!