Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VSCODE: Cannot read property 'local' of undefined

OS: Ubuntu 16.04 VS Code Version: 1.32.3

I can't install any extensions for my vs code. When I click "install", the error

"Cannot read property 'local' of undefined"

I also tried to install manually, and it doesn't work too.

Error image

like image 258
Zigang Fu Avatar asked Mar 22 '19 09:03

Zigang Fu


People also ask

Why C++ IntelliSense not working Vscode?

Troubleshooting# If you find IntelliSense has stopped working, the language service may not be running. Try restarting VS Code and this should solve the issue. If you are still missing IntelliSense features after installing a language extension, open an issue in the repository of the language extension.

How do I restart IntelliSense Vscode?

Starting in version 0.12. 3 of the extension, there is a command to reset your IntelliSense database. Open the Command Palette (Ctrl+Shift+P) and choose the C/C++: Reset IntelliSense Database command.


3 Answers

It is most probably because Code doesn't have privilege to write to the extension folder, which is by default ~/.vscode/extension.

The following command from terminal will fix it:

sudo chown -R $(whoami) ~/.vscode
like image 150
Ignatius Avatar answered Oct 16 '22 03:10

Ignatius


I experienced the same problem on Windows 10. Permissions in my case were not the problem. Try clearing the contents extensions folder which can normally be found here;

C:\Users\USERNAME\.vscode\extensions

This fixed the issue for me.

If you're looking more details on any error that might be causing your problems, try the following steps to open the developer console to check for errors.

CTRL+SHIFT+P >> Developer: Toggle Shared Process

When I tried this I got the following errors (prior to clearing the extensions folder);

Uncaught (in promise) Error: EPERM: operation not permitted, open 'C:\Users\Ryan\.vscode\extensions\.obsolete'

and

Uncaught (in promise) W: EPERM: operation not permitted, open 'C:\Users\Ryan\.vscode\extensions\.obsolete'
at t.push.scanUserExtensions.then.e (file:///C:/Program Files/Microsoft VS Code/resources/app/out/vs/code/electron-browser/sharedProcess/sharedProcessMain.js:257:223)

Visual Studio Code Windows Error

like image 1
Ryan McCartney Avatar answered Oct 16 '22 03:10

Ryan McCartney


If you get Cannot read property 'id' of undefined in vscode, there is probably a custom setting in C:\Users\myself\AppData\Roaming\Code\User\settings.json with a reference to a thing that is no more available. In my case it was a changed theme name, so the old name could not be referenced any more.

After removing that setting, the problem was solved.

like image 1
domih Avatar answered Oct 16 '22 05:10

domih