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

Viewed 6266

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?

5 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"
}

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!

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.

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

Error "(this.configurationService.getValue(...) || []).filter is not a function" in Windows in Vscode

TL:DR;

Remove "workbench.editorAssociations": { "*.ipynb": "jupyter.notebook.ipynb" } in Windows from settings.json (In Linux Ubuntu it works though, you can leave it as is).

  • Same solution as others here say
  • Down the road: I use both environments and git version the settings.json, so I better remove it to avoid the error and be able to read files.
  • Linux is the reason for the error in Windows.
Related