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

the editor could not be opened due to an unexpected error: cannot read properties of null (reading 'create') #5133

Open
6 tasks done
Rom265 opened this issue Feb 1, 2025 · 8 comments
Labels

Comments

@Rom265
Copy link

Rom265 commented Feb 1, 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

I try to run a script with

wait-debugger; & MyCommand

(where & MyCommand stands in for some command), a tab opens in VS Code with a red circle with an X. It says, "the editor could not be opened due to an unexpected error: cannot read properties of null (reading 'create')" with a "Try Again" button.
I have seen this a few times recently. If I close and reopen VS Code (a frequent fix for when it bugs out), it still keeps doing that.
It looks like an error from VS Code, but it happens when I'm trying to run the debugger with Powershell; so, it probably makes most sense to post this here first.

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       : c84edc60-e725-42a9-954c-cb01d1fea8ba
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.96.4
cd4ee3b1c348a13bafd8f9ad8060705f6d4b9cba
x64

Extension Version

Steps to Reproduce

write command. Hit enter.
The call stack shows paused on step:

Visuals

Image

Logs

No response

@Rom265 Rom265 added Issue-Bug A bug to squash. Needs: Triage Maintainer attention needed! labels Feb 1, 2025
@andyleejordan
Copy link
Member

We don't have great debug state syncing between the extension terminal and LSP just yet (it's a work in progress PR). Without more info to debug, I can only suggest using the VS Code debugger UI to set breakpoints and debug whatever you're trying to.

@andyleejordan andyleejordan added Resolution-Answered Will close automatically. and removed Needs: Triage Maintainer attention needed! labels Feb 4, 2025
Copy link
Contributor

github-actions bot commented Feb 4, 2025

This issue has been labeled as resolved, please verify the provided fix (or other reason).

@github-actions github-actions bot added the Needs: Fix Verification Please verify the fix for us! label Feb 4, 2025
@Rom265
Copy link
Author

Rom265 commented Feb 4, 2025

We don't have great debug state syncing between the extension terminal and LSP just yet (it's a work in progress PR). Without more info to debug, I can only suggest using the VS Code debugger UI to set breakpoints and debug whatever you're trying to.

I reverted to the previous version of the Powershell extension and it has not happened since.

@github-actions github-actions bot added Needs: Maintainer Attention Maintainer attention needed! and removed Needs: Fix Verification Please verify the fix for us! labels Feb 4, 2025
Copy link
Contributor

github-actions bot commented Feb 4, 2025

This issue has been labeled as resolved, please verify the provided fix (or other reason).

@github-actions github-actions bot added Needs: Fix Verification Please verify the fix for us! and removed Needs: Maintainer Attention Maintainer attention needed! labels Feb 4, 2025
@LKo-exp4
Copy link

LKo-exp4 commented Feb 10, 2025

We don't have great debug state syncing between the extension terminal and LSP just yet (it's a work in progress PR). Without more info to debug, I can only suggest using the VS Code debugger UI to set breakpoints and debug whatever you're trying to.

I can confirm, that i face the issue with the VSCode debugger and breakpoints as well. If you want to Step-Into a function, vscode falls into the described issue in that post.

I also can confirm the resolution of @Rom265 : Switch back from Version 2025.0.0 to 2024.4.0

@github-actions github-actions bot added Needs: Maintainer Attention Maintainer attention needed! and removed Needs: Fix Verification Please verify the fix for us! labels Feb 10, 2025
Copy link
Contributor

This issue has been labeled as resolved, please verify the provided fix (or other reason).

@github-actions github-actions bot added Needs: Fix Verification Please verify the fix for us! and removed Needs: Maintainer Attention Maintainer attention needed! labels Feb 10, 2025
@JustinGrote JustinGrote removed the Needs: Fix Verification Please verify the fix for us! label Feb 10, 2025
@JustinGrote
Copy link
Collaborator

@LKo-exp4 is it specific to wait debugger or are you using a launch configuration? Can you record a reproduction? In Windows 11 you can hit win-shift-R to get native recording and it's pasteable directly into github.

@JustinGrote JustinGrote added Area-Debugging and removed Resolution-Answered Will close automatically. labels Feb 10, 2025
@andyleejordan
Copy link
Member

I confirmed that I have no issue using Step-Into etc. with v2025.0.0 and PowerShell 7.4. I also tried Wait-Debugger; & Get-ChildItem (and a command that came from a sourced script) with no problems. We need further repro steps / logs to look into this. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants