Skip to content

VSCode Extension: Certain unhandled events throw errors #137

@TMA-2

Description

@TMA-2

Description

A number of normal actions or events seem to be unhandled, and as such generate exceptions in VSCode. For instance, issue #133 is apparently due to the command not existing internally, but still defined in the extension package. Another is that pressing 'Cancel' or closing dialog boxes (e.g. file selection) isn't handled, resulting in a "Cannot read properties of undefined" exception".

Expected Behavior

When closing a file open dialog or canceling an action or command, no exception or output should occur. For instance:

  • Canceling or closing the reflection file selection dialog
  • Canceling or closing the Quick Script file selection dialog

Actual Behavior

A VSCode error popup is shown with the error "Cannot read properties of undefined (reading 'forEach')". See log output for details.

Log

Nothing displayed in the extension output log. However, the extension host contains the details:

2025-04-26 16:57:23.561 [error] TypeError: Cannot read properties of undefined (reading 'forEach')
    at ReflectionCommands.<anonymous> (c:\Users\tma2\.vscode\extensions\ironmansoftware.powershellprotools-2024.12.0\out\commands\reflection.js:51:20)
    at Generator.next (<anonymous>)
    at fulfilled (c:\Users\tma2\.vscode\extensions\ironmansoftware.powershellprotools-2024.12.0\out\commands\reflection.js:5:58) poshProTools.loadAssembly {"value":"ironmansoftware.powershellprotools","_lower":"ironmansoftware.powershellprotools"}

Versions

  • OS Windows 11 23H2
  • VS Code 1.99.3
  • PowerShell 7.5.0
  • PowerShell Extension 2025.0.0
  • PowerShell Pro Tools 2024.12.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions