Issue Type: Bug
I updated VSCode yesterday and now everytime I start VScode it starts with all my extensions disabled. Tried reinstalling VSCode, but did not work.
All my extensions appear in the "Disabled" area. The only solution to make it work is if I "Disable all extensions" and then "Enable all extensions".
If after this I close vscode, it starts again with disabled extensions.
VS Code version: Code 1.39.1 (88f15d17dca836346e787762685a40bb5cce75a8, 2019-10-10T23:31:28.683Z)
OS version: Windows_NT x64 10.0.18362
System Info
|Item|Value|
|---|---|
|CPUs|Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz (8 x 2808)|
|GPU Status|2d_canvas: enabled
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
native_gpu_memory_buffers: disabled_software
oop_rasterization: disabled_off
protected_video_decode: enabled
rasterization: enabled
skia_deferred_display_list: disabled_off
skia_renderer: disabled_off
surface_synchronization: enabled_on
video_decode: enabled
viz_display_compositor: disabled_off
webgl: enabled
webgl2: enabled|
|Load (avg)|undefined|
|Memory (System)|15.89GB (6.74GB free)|
|Process Argv||
|Screen Reader|no|
|VM|0%|
Extensions (54)
Extension|Author (truncated)|Version
---|---|---
rainbow-brackets|2gu|0.0.6
better-comments|aar|2.0.5
ignoregit|And|1.0.1
color-info|bie|0.5.1
npm-intellisense|chr|1.3.0
path-intellisense|chr|1.4.2
vscode-eslint|dba|1.9.1
gitlens|eam|10.1.1
EditorConfig|Edi|0.14.1
vscode-npm-script|eg2|0.3.9
LogFileHighlighter|emi|2.6.0
auto-close-tag|for|0.5.6
auto-using|Fud|0.7.9
gc-excelviewer|Gra|2.1.32
beautify|Hoo|1.5.0
icon-fonts|idl|2.2.2
changelog|jac|0.0.6
search-node-modules|jas|1.3.0
csharpextensions|jch|1.3.0
node-module-intellisense|lei|1.5.0
csharpfixformat|Leo|0.0.84
csharp-colors|log|0.1.7
bash-ide-vscode|mad|1.3.3
CamelCase|Mar|1.0.4
change-string-case|max|1.1.1
rainbow-csv|mec|1.3.1
git-graph|mhu|1.17.0
gitignore|mic|1.0.1
dotenv|mik|1.0.1
azure-pipelines|ms-|1.157.4
mssql|ms-|1.6.0
remote-ssh|ms-|0.47.1
remote-ssh-edit|ms-|0.47.1
remote-ssh-explorer|ms-|0.47.1
remote-wsl|ms-|0.39.9
azure-account|ms-|0.8.6
csharp|ms-|1.21.4
powershell|ms-|2019.9.0
debugger-for-chrome|msj|4.12.0
color-highlight|nau|2.3.0
indent-rainbow|ode|7.4.0
material-icon-theme|PKi|3.9.1
remote-vscode|raf|1.1.0
RocketseatReactJS|roc|2.2.0
RocketseatReactNative|roc|2.2.0
bash-debug|rog|0.3.6
bash-beautify|sha|0.1.1
code-settings-sync|Sha|3.4.3
markdown-preview-enhanced|shd|0.4.3
guides|spy|0.9.3
ansible-autocomplete|tim|0.0.2
nodejs-extension-pack|wad|0.1.9
vscode-wakatime|Wak|2.2.0
JavaScriptSnippets|xab|1.7.2
(1 theme extensions excluded)
Visual info:

Errors on startup (Disabled extensions) in developer tools:
/C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.desktop.main.js:3390 TypeError: Cannot read property '__metadata' of undefined
at d.readFile.then.e (/C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.desktop.main.js:3527)
_logMessageInConsole @ /C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.desktop.main.js:3390
Ok this is another instance of https://github.com/microsoft/vscode/issues/82318
Adding candidate, assigning to @sandy081
@joaomoreno a more complete stack trace can be found here: https://github.com/microsoft/vscode/issues/82181#issue-504906007
Got a repro:
diff --git a/src/vs/workbench/services/extensions/node/extensionPoints.ts b/src/vs/workbench/services/extensions/node/extensionPoints.ts
index 17fdf323c7..15a9cb9889 100644
--- a/src/vs/workbench/services/extensions/node/extensionPoints.ts
+++ b/src/vs/workbench/services/extensions/node/extensionPoints.ts
@@ -50,7 +50,8 @@ class ExtensionManifestParser extends ExtensionManifestHandler {
public parse(): Promise<IExtensionDescription> {
return pfs.readFile(this._absoluteManifestPath).then((manifestContents) => {
const errors: json.ParseError[] = [];
- const manifest = json.parse(manifestContents.toString(), errors);
+ let manifest = json.parse(manifestContents.toString(), errors);
+ manifest = undefined!;
if (errors.length === 0) {
if (manifest.__metadata) {
manifest.uuid = manifest.__metadata.id;

Likely culprit is https://github.com/microsoft/vscode/commit/479563e361f3face96b36220e7fe75384377e17f cc @aeschli
@aeschli https://github.com/microsoft/vscode/commit/479563e361f3face96b36220e7fe75384377e17f was a dangerous change because while JSON.parse would throw on parse errors, our custom json.parse doesn't and while its documentation reads On invalid input, the parser tries to be as fault tolerant as possible, but still return a result. it seems that there are cases in which the result it returns is undefined, which is what is happening here. The code happily continues and assumes manifest is an object.
Repro steps:
package.json file and make it emptyPushing a fix for this. Next steps to improve stability are https://github.com/microsoft/vscode/issues/82504
Ah I see. The difference is that our parser doesn't emit an error if the content is empty, while JSON.parse does.
If you are hitting this issue, there's no real workaround for now, somehow you have a corrupted built-in extension manifest file. That should not block all other extensions, of course, so we're pushing a fix for the 1.39.2 recovery release. Until that's released, you can either reinstall VS Code or find the corrupt package.json and fix it.
Verified that the issue is resolved with the latest version 1.39.2.
Most helpful comment
Verified that the issue is resolved with the latest version 1.39.2.