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

In node.js REPL, after evaluating "global", accessing anything from global scope causes TS2669 #1067

Closed
panta82 opened this issue Jun 21, 2020 · 4 comments
Labels
bug you can do this Good candidate for a pull request.
Milestone

Comments

@panta82
Copy link

panta82 commented Jun 21, 2020

Expected Behavior

You can do something like:

> global // show global object
> Number // prints "[Function: Number]"

Actual Behavior

image

Steps to reproduce the problem

  1. Install @types/node
  2. Start ts-node in REPL mode
  3. Type "global"
  4. Type "Number"

Minimal reproduction

https://github.com/panta82/ts-node-minimal-reproduction

Specifications

  • ts-node v8.10.2
  • node v14.4.0
  • compiler v3.9.5
  • Operating system and version: Linux 5.4.0-37-generic 18.04.1-Ubuntu
@panta82 panta82 changed the title In node.js REPL, after evaluating global, accessing anything from global scope prints "Augmentations for the global scope can only be directly nested in external modules or ambient module declarations" In node.js REPL, after evaluating global, accessing anything from global scope causes TS2669 Jun 21, 2020
@panta82 panta82 changed the title In node.js REPL, after evaluating global, accessing anything from global scope causes TS2669 In node.js REPL, after evaluating "global", accessing anything from global scope causes TS2669 Jun 21, 2020
@cspotcode
Copy link
Collaborator

cspotcode commented Jun 21, 2020 via email

@cspotcode cspotcode added bug you can do this Good candidate for a pull request. labels Jul 9, 2020
@cspotcode
Copy link
Collaborator

Marked as "help wanted" to indicate that we will wait for a pull request fixing this bug. It's minor and seems like a straightforward contribution.

@ejose19
Copy link
Contributor

ejose19 commented Oct 27, 2021

FWIW, this issue no longer reproduces on latest versions (10.2.1+)

@cspotcode
Copy link
Collaborator

Good catch, looks like this was fixed by #1480. That was released in 10.3.0, and I can reproduce this issue on 10.2.1 but not on 10.3.0.

@cspotcode cspotcode added this to the 10.3.0 milestone Oct 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug you can do this Good candidate for a pull request.
Projects
None yet
Development

No branches or pull requests

3 participants