18

So I was working on a project and today I saw an error about VScode being unable to resolve package.json schema:

CSS contributions to package.json

Problems loading reference 'vscode://schemas/settings/configurationDefaults': Unable to load schema from 'vscode://schemas/settings/configurationDefaults': cannot open vscode://schemas/settings/configurationDefaults. Detail: Unable to resolve text model content for resource vscode://schemas/settings/configurationDefaults.

It is somewhat similar to file: 'package.json' severity: 'Warning' message: 'Problems loading reference '': Unable to load schema from '': Unable to to connect to BUT the issue is my error is about the local file. I'm wondering why this happened and how I can "undo" this. Some answers revolve around network settings and the one from form linked question suggests adding a schema manually to settings, but I'm not sure why I would have to do that, since it was working fine before.

I can not pinpoint any specific activity before this error appeared. Any ideas on what could be the cause?

VivaceNonTroppo
  • 456
  • 1
  • 3
  • 13

5 Answers5

33

At wits end - I opened the vscode Settings Editor. In the Workspace tab I opened Workbench, and under that selected Settings Editor. In there I found an empty checkbox beside Open Default Settings and checked it. The error went away. I have no idea why, but it seems happier now.

Marvin Budd
  • 431
  • 2
  • 2
  • 3
    This worked for me too, although a restart of VS Code was required before it took effect. I suspect this is related to the rollout of profiles. Prior to that they probably didn't have any other behaviour because there wasn't any other option - I think ticking that option effectively returns you to pre-profiles behaviour for the schema in question. – Peter Wone Mar 03 '23 at 07:08
  • 5
    Just toggling the option worked for me. It was off before. Ticked the box -> the error disappeared -> unticked the box -> error stayed gone. Even after a restart. ‍♀️ – puelo May 22 '23 at 14:05
  • This helped me at first, but the warning came back later. I figured out it was somehow related to the Tailwind CSS Intellisense extension. I wasn't using tailwind in that project and so disabled it for the workspace and the warning went away. The warning is not present-even without the setting change-in my project that uses tailwind. – timmywil Aug 12 '23 at 14:26
-2

The error message indicates that there was an issue loading the default settings schema in VS Code. The settings schema defines the structure and validation rules for various settings in VS Code.

When you checked the "Open Default Settings" checkbox in the VS Code Settings Editor, you enabled the use of the default settings for the Workbench in your workspace. By doing this, VS Code might have reloaded or reinitialised the settings configuration, resolving any misconfiguration or issues that were causing the error.

It's important to note that the exact reason for the error can be challenging to determine without further investigation. Such errors can occur due to various factors, including:

Corrupted Settings: There could have been a corruption or misconfiguration in the workspace or user settings files that caused the error.

Extensions: Certain extensions may interfere with VS Code settings, causing issues with schema loading.

Syntax Errors: If there were any syntax errors in the settings JSON files, it could have resulted in the error.

Conflict with Workspace Files: Conflicts with workspace-specific settings or extensions might have triggered the error.

By checking the "Open Default Settings" checkbox, you might have restored the default settings for the Workbench, effectively resolving any underlying misconfiguration or corruption that was causing the error.

lachi
  • 1
  • 2
    Using ChatGPT to post answers is not allowed. See https://meta.stackoverflow.com/questions/421831/temporary-policy-chatgpt-is-banned – Eric Aya Jul 25 '23 at 14:15
-3

Try closing and re-opening VScode.

  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community May 25 '23 at 13:26
-5

Restart the VSCode and the problem goes away

zhixilan
  • 9
  • 2
-6

close and re-open the vscode. There will be no error.

  • Please provide more detail about how and why this fixes it. "Reboot and it goes away" seems like a temporary workaround for the issue, rather than a permanent fix. – braindigitalis Jul 07 '23 at 11:04