Skip to content

attempting to enter debugger from commandline gives error in extension version 2025.0.0 #5175

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

Open
6 tasks done
Rom265 opened this issue Apr 16, 2025 · 3 comments
Open
6 tasks done
Labels
Area-Debugging Issue-Bug A bug to squash. Verified This issue has been determined to be a legitimate issue that requires a fix.

Comments

@Rom265
Copy link

Rom265 commented Apr 16, 2025

Prerequisites

  • I have written a descriptive issue title.
  • I have searched all open and closed issues to ensure it has not already been reported.
  • I have read the troubleshooting guide.
  • I am sure this issue is with the extension itself and does not reproduce in a standalone PowerShell instance.
  • I have verified that I am using the latest version of Visual Studio Code and the PowerShell extension.
  • If this is a security issue, I have read the security issue reporting guidance.

Summary

Starting with Powershell extension version 2025.0.0, whenever I do something at the terminal command prompt that tries to engage the debugger, a screen opens up with this error message, "The editor could not be opened due to an unexpected error. Please consult the log for more details."

Image

I found logs at ...AppData\Roaming\Code\User\globalStorage\ms-vscode.powershell\logs , but the files under the random GUID type folder there haven't been written to since February; so, I don't know what that means or if there are logs elsewhere.

Usually, I can open another file, paste my command in there and hit F5 and that works. But, sometimes even then I get the error message. And, that's pretty clumsy. In previous versions of the extension, I was able to put wait-debugger; in front of my command when I wanted to make it go into the debugger. But, if I just run a command like Get-Process -Name bogus -ErrorAction Break I also get the error.

This has happened with 3 different machines and it's pretty consistent.

Does anyone use something other than VS Code with the Powershell extension to debug Powershell scripts? What's the most popular way to do this?

PowerShell Version

Name                           Value
----                           -----
PSVersion                      7.4.7
PSEdition                      Core
GitCommitId                    7.4.7
OS                             Microsoft Windows 10.0.17763
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Name             : Visual Studio Code Host
Version          : 2025.0.0
InstanceId       : 61447b12-1895-4529-80b3-43f5430cb6fd
UI               : System.Management.Automation.Internal.Host.InternalHostUserInterface
CurrentCulture   : en-US
CurrentUICulture : en-US
PrivateData      : Microsoft.PowerShell.ConsoleHost+ConsoleColorProxy
DebuggerEnabled  : True
IsRunspacePushed : False
Runspace         : System.Management.Automation.Runspaces.LocalRunspace

Visual Studio Code Version

1.98.1
2fc07b811f760549dab9be9d2bedd06c51dfcb9a
x64

Extension Version

ms-vscode.?[7mpowershell?[[email protected]

Steps to Reproduce

run a command in the terminal that tries to open the debugger

Visuals

No response

Logs

No response

@Rom265 Rom265 added Issue-Bug A bug to squash. Needs: Triage Maintainer attention needed! labels Apr 16, 2025
Copy link

We've found some similar issues:

If any of the above are duplicates, please consider closing this issue out and adding additional context in the original issue.

Note: You can give me feedback by 👍 or 👎 this comment.

@Rom265
Copy link
Author

Rom265 commented Apr 16, 2025

if I click Retry, I get this dialog box that says, "Unable to open '.' Cannot read properties of null (reading 'create')"

Image

@JustinGrote
Copy link
Collaborator

Thanks for your submission!

I can reproduce this, it tries to open '.' in the editor for me.

Image

No obvious logs other than executeMode dotsource which is suspicious in this context

Image

Note that "F5" for interactive mode with this launch config doesn't cause the problem. It's what I usually use so it's probably why I didn't see this previously.

      {
        "name": "PS: Interactive",
        "presentation": {
          "group": "Powershell"
        },
        "request": "launch",
        "type": "PowerShell"
      },

@JustinGrote JustinGrote added Area-Debugging Verified This issue has been determined to be a legitimate issue that requires a fix. and removed Needs: Triage Maintainer attention needed! labels Apr 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Debugging Issue-Bug A bug to squash. Verified This issue has been determined to be a legitimate issue that requires a fix.
Projects
None yet
Development

No branches or pull requests

2 participants