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 imported modules in the VSCode debug console #43328

Closed
Christilut opened this issue Mar 21, 2021 · 3 comments
Closed

Using imported modules in the VSCode debug console #43328

Christilut opened this issue Mar 21, 2021 · 3 comments
Labels
External Relates to another program, environment, or user action which we cannot control.

Comments

@Christilut
Copy link

Bug Report

When using the VSCode Debug Console when the execution is paused, I get this for everything that is imported:
Uncaught ReferenceError: Foo is not defined

This is on a simple piece of code like this:

import Foo from 'foo'

Foo.bar()

When I run this in the debug console: Foo.bar()

I can work around it in the debug console like this:
_Foo.Foo.bar()

In the closure scope, all the imported modules are shown and that's where I got the _Foo from.

Seems like when running Typescript, this should just work in the debug console?

🔎 Search Terms

"debug console"

🕗 Version & Regression Information

Node 12.20.1
VSCode 1.54.1
Typescript 4.1.2

💻 Code

Tsconfig:

{
  "compilerOptions": {
    "target": "ES2019",
    "module": "commonjs",
    "strict": true,
    "outDir": "dist",
    "importHelpers": true,
    "moduleResolution": "node",
    "experimentalDecorators": true,
    "skipLibCheck": true,
    "esModuleInterop": true,
    "allowSyntheticDefaultImports": true,
    "strictPropertyInitialization": false,
    "strictNullChecks": false,
    "noImplicitAny": false,
    "sourceMap": true,
    "baseUrl": ".",
    "paths": {
      "*": [
        "node_modules/*"
      ]
    },
    "lib": [
      "dom"
    ]
  },
  "include": [
    "src/**/*",
    "tests/**/*.test.ts"
  ],
  "exclude": [
    "snippets/**/*"
  ]
}

🙁 Actual behavior

Getting an error in the debug console when copy pasting a piece of source code with imported module that should be able to run as is.

🙂 Expected behavior

Every piece of source code where the debugger is currently paused, should be runnable in the debug console.

@Christilut
Copy link
Author

This issue is reported here as well, but it might be more Typescript related.

@IllusionMH
Copy link
Contributor

See existing microsoft/vscode#12066 and #9627

@RyanCavanaugh RyanCavanaugh added the External Relates to another program, environment, or user action which we cannot control. label Mar 22, 2021
@typescript-bot
Copy link
Collaborator

This issue has been marked as 'External' and has seen no recent activity. It has been automatically closed for house-keeping purposes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
External Relates to another program, environment, or user action which we cannot control.
Projects
None yet
Development

No branches or pull requests

4 participants