Skip to content

TypeError: Cannot read properties of undefined when refreshing Pester tests #279

@gerardmchale

Description

@gerardmchale

I am using VS Code for my PowerShell development. I have version 5.1 of PowerShell and version 1.95.3 of VS Code. I have the Pester extension installed in VS Code (version v2023.7.7). Until recently, I've had no issue with this extension but in the last few days whenever I try to refresh my Pester tests in VS Code I get the popup with the error message Cannot read properties of undefined (reading 'controllerId').

I have attached the log file Pester_extension_logs.log showing the full output from the VS Code.

I also noticed that if I try to run the tests after getting the error message above they will run but I get some strange errors that don't make any sense (e.g. functions not available for imported modules and directories not available even though they exist on the local machine).

If I run the same Pester tests from the command line, they pass without any problems, which suggests that the problem is not in the Pester tests but in the VS Code extension.

I have tried:

  • Restarting VS Code
  • Reinstalling the Pester extension
  • Disabling all other extensions
  • Reverting my code to an old version where I never saw the problem occur

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