Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
thelazydogsback opened this issue Aug 28, 2020 · 7 comments

Comments

@thelazydogsback
Copy link

thelazydogsback commented Aug 28, 2020

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

@hediet
Copy link
Owner

hediet commented Aug 29, 2020

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

@thelazydogsback
Copy link
Author

thelazydogsback commented Aug 29, 2020

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

@hediet
Copy link
Owner

hediet commented Aug 29, 2020

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

@thelazydogsback
Copy link
Author

image

@hediet
Copy link
Owner

hediet commented Aug 29, 2020

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

@thelazydogsback
Copy link
Author

thelazydogsback commented Aug 29, 2020

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
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants