vscode-debug-visualizer
vscode-debug-visualizer copied to clipboard
Using from JS "global not defined" no matter what I try and inspect
Using debug-visualizer V2.0.6. Breakpoint in Jest unit test. All see is "global is not defined" no matter what variable (or const expr) I type into the expression area.
thanks
========= Version: 1.48.2 (user setup) Commit: a0479759d6e9ea56afa657e454193f72aef85bd0 Date: 2020-08-25T10:13:11.295Z Electron: 7.3.2 Chrome: 78.0.3904.130 Node.js: 12.8.1 V8: 7.8.279.23-electron.0 OS: Windows_NT x64 10.0.19041
Which nodejs version do you run jest in? global should be available since node v0.1.27.
13.5.0
{ node: "13.5.0", v8: "7.9.317.25-node.23", uv: "1.34.0", zlib: "1.2.11", brotli: "1.0.7", ares: "1.15.0", modules: "79", nghttp2: "1.40.0", napi: "5", llhttp: "2.0.1", openssl: "1.1.1d", cldr: "36.0", icu: "65.1", tz: "2019c", unicode: "12.1", }
Can you type "global\n" into the debug console?

This does not make sense. I will debug it tomorrow. What is the global object called then? window??
Not window either. I don't know -- I've never used such a thing in Node -- only in browsers.
Looks like it should: https://nodejs.org/api/globals.html#globals_global
Definitely has to do with the environment when running from Jest -- if I write a simple helloWorld app.js and debug it normally, I don't get this issue.