Error in VS Code [Unable to write into user settings. Please open the user settings to correct errors/warnings in it and try again.]

5,211

Solution 1

I suggest to validate your JSON in an online JSON validator like jsonlint for better info where the problem lies.

Also, as mentioned in this SO post and this SO post, that leading 0's on a number would also cause this kind of issue.

If you have a number, don't ever store it with leading zeroes. If you have a value that needs to have a leading zero, don't treat it as a number, but as a string. Store it with quotes around it.

Here is an example:

Invalid

{
  "attribute": "// numeroConta",
  "operator": "=",
  "value": 0030152201

}

enter image description here

Valid

{
  "attribute": "// numeroConta",
  "operator": "=",
  "value": "0030152201"
}

enter image description here

Please provide your settings.json if this is not the case.

Solution 2

One of the most common causes for this is presence of comments inside JSON file. While vscode itself loads config with json-with-comments format, the sync part fails and when you use the GUI to configure settings it fails to update the settings.json file, even if you will not see any error/warning reported on the file.

Share:
5,211
Admin
Author by

Admin

Updated on December 18, 2022

Comments

  • Admin
    Admin over 1 year

    While changing any setting in Visual Studio I'm getting an error like this:

      Unable to write into user settings. Please open the user settings to correct errors/warnings in it and try again.
    

    In the settings.json There is a problem as:

         Expected Comma JsonC(514)
    

    Error Code:

    enter image description here