vscode-debug-visualizer icon indicating copy to clipboard operation
vscode-debug-visualizer copied to clipboard

Using from JS "global not defined" no matter what I try and inspect

Open thelazydogsback opened this issue 5 years ago • 8 comments

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

thelazydogsback avatar Aug 28 '20 23:08 thelazydogsback

Which nodejs version do you run jest in? global should be available since node v0.1.27.

hediet avatar Aug 29 '20 00:08 hediet

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", }

thelazydogsback avatar Aug 29 '20 00:08 thelazydogsback

Can you type "global\n" into the debug console?

hediet avatar Aug 29 '20 00:08 hediet

image

thelazydogsback avatar Aug 29 '20 00:08 thelazydogsback

This does not make sense. I will debug it tomorrow. What is the global object called then? window??

hediet avatar Aug 29 '20 00:08 hediet

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

thelazydogsback avatar Aug 29 '20 00:08 thelazydogsback

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.

thelazydogsback avatar Aug 29 '20 01:08 thelazydogsback