Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VS Code Error: (this.configurationService.getValue(...) || []).filter is not a function

I just started getting this error in VS Code that prevents me from create a new file or even opening a file. The pop error that VS Code shows is (this.configurationService.getValue(...) || []).filter is not a function

This error/bug even stops me from opening the extensions tab or launching basic hotkeys. Anybody else have this issue?

like image 506
WhoIsCarlo Avatar asked May 18 '21 13:05

WhoIsCarlo


People also ask

How do you get rid of the blue squiggly lines in Vscode?

Press command+shift+p (open command pallete) Then type Disable Error Squiggles. And click on that Disable Error Squiggles.

How do you get rid of the yellow line in VS code?

“visual studio code à remove yellow lines” Code Answer'sPress Ctrl + H (quick replace). Click "Use Regular Expressions". Click "Replace All". All Blank lines will be deleted.


4 Answers

I had the same problem.

Found few errors in settings.json. Try to check it and let me know how it will go.

This error pops up every time I try to create a new file saying

"(this.configurationService.getValue(...) || []).filter is not a function"

In my case, I had to fix "workbench.editorAssociations" flag to:

"workbench.editorAssociations": [
    {
        "viewType": "jupyter-notebook",
        "filenamePattern": "*.ipynb"
    }
],

Previously it was:

"workbench.editorAssociations": {
    "*.ipynb": "jupyter-notebook"
}
like image 91
narwanimonish Avatar answered Oct 19 '22 17:10

narwanimonish


I figured out the issue in the error is coming from the settings.json for VS Code (found here for mac ~/Library/Application Support/Code/User/settings.json). There was an extension that updated got updated with a bug. My particular one seems like it came from this line:

"workbench.editorAssociations": { "*.ipynb": "jupyter.notebook.ipynb" }

Anyways, hope this is helpful for someone in the future!

like image 38
WhoIsCarlo Avatar answered Oct 19 '22 19:10

WhoIsCarlo


Happened to me after I synced my settings between Visual Studio Code (the stable version) and "Visual Studio Code - Insiders".

For me, this error prevented Jupyter notebooks to be opened in Visual Studio Code.

Replacing the Jupyter notebook setting as suggested by this comment and implied by its above answer did not work for me.

What worked for me was to delete all Jupyter related entries in settings.json.

like image 1
alelom Avatar answered Oct 19 '22 19:10

alelom


I had the same error, where the jupyter-notebook extension was updated and caused a bug.

In the settings navigate to "workbench.editorAssociations",

replace

 "*.ipynb": "jupyter-notebook"

with

 "viewType": "jupyter-notebook",
 "filenamePattern": "*.ipynb"

and everything will work fine.

For the settings file,

By default VS Code shows the Settings editor, but you can still edit the underlying settings.json file by using the Open Settings (JSON) command or by changing your default settings editor with the workbench.settings.editor setting.

Depending on your platform, the user settings file is located here:

Windows %APPDATA%\Code\User\settings.json

macOS $HOME/Library/Application Support/Code/User/settings.json

Linux $HOME/.config/Code/User/settings.json

like image 1
Mostafa Wael Avatar answered Oct 19 '22 19:10

Mostafa Wael