Skip to content

Unable to resolve your shell environment: Unexpected end of JSON input (vscode launch) #251901

Open
@aschor

Description

@aschor

Does this issue occur when all extensions are disabled?: Yes

  • VS Code Version: 1.101.0 (system setup)
  • OS Version: Windows_NT x64 10.0.22621

Steps to Reproduce:

  1. Launch vscode with menu shortcut
  2. get the error notification

Additional informations :

I added "--verbose" to the vscode shortcut :

Image

With this, I get the underlying problem in the "main" logs :

2025-06-19 14:24:55.255 [trace] doResolveShellEnv#spawn ["-Command"] Write-Output 'a6ad6f0ec1bb'; [System.Environment]::GetEnvironmentVariables() | ConvertTo-Json -Compress; Write-Output 'a6ad6f0ec1bb'
2025-06-19 14:24:55.551 [trace] NativePolicyService#_updatePolicyDefinitions - Found 9 policy definitions
2025-06-19 14:24:55.552 [trace] NativePolicyService#_onDidPolicyChange - Updated policy values: {}
2025-06-19 14:24:55.552 [trace] PolicyConfiguration#onDidChangePolicies []
2025-06-19 14:24:55.553 [trace] PolicyConfiguration#update []
2025-06-19 14:24:55.554 [trace] NativePolicyService#_updatePolicyDefinitions - Found 11 policy definitions
2025-06-19 14:24:55.555 [trace] NativePolicyService#_onDidPolicyChange - Updated policy values: {}
2025-06-19 14:24:55.555 [trace] PolicyConfiguration#onDidChangePolicies []
2025-06-19 14:24:55.555 [trace] PolicyConfiguration#update []
2025-06-19 14:24:55.751 [trace] window#load: window reported ready (id: 1)
2025-06-19 14:24:55.751 [trace] ElectronURLListener#flush(): flushing URLs
2025-06-19 14:24:55.840 [trace] doResolveShellEnv#raw a6ad6f0ec1bb
a6ad6f0ec1bb
2025-06-19 14:24:55.840 [trace] doResolveShellEnv#stderr Impossible d'appeler la m�thode. L'appel aux m�thodes n'est pris en charge que sur les types principaux dans ce mode 
de langage.
Au caract�re Ligne:1 : 30
+ ... d6f0ec1bb'; [System.Environment]::GetEnvironmentVariables() | Convert ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation : (:) [], RuntimeException
    + FullyQualifiedErrorId : MethodInvocationNotSupportedInConstrainedLanguage

If :

  1. I launch code from cmd (in windows terminal), I DO NOT get that issue
  2. I launch the command C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe -Command "Write-Output 'a6ad6f0ec1bb'; [System.Environment]::GetEnvironmentVariables() | ConvertTo-Json -Compress; Write-Output 'a6ad6f0ec1bb'" from command line, I DO get the issue.

edit : I would say it started throwing this error c.a. 1 week ago, and I saw a vscode (automatic) update in my applications on June 13, when I tried uninstalling reinstalling, so maybe (re)introduced in version 1.101

Metadata

Metadata

Assignees

Labels

bugIssue identified by VS Code Team member as probable bugshell-env

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions