Visual Studio Code - Type Script - Unable to load tsconfig.json and packages.json schemas

Viewed 15838

I'm working on an Angular front end in Visual Studio Code for an app with a C# windows service back end. After spending a few days on the back end without touching the front end, I found that Visual Studio Code would no longer automatically recompile my typescript code every time I saved. Instead, I would have to ctrl+c out of the process and run "npm start" again.

I ensured that compileOnSave was set to true in my tsconfig.json. In doing so, I notice a warning:

Problems loading reference 'http://json.schemastore.org/tsconfig': Unable to load schema from 'http://json.schemastore.org/tsconfig': Unable to to connect to http://json.schemastore.org/tsconfig. Error: getaddrinfo ENOTFOUND json.schemastore.org json.schemastore.org:80

I noticed a similar warning for packages.json. I'm able to load the schema on the links on Google Chrome.

What could be a possible fix? Could I download the schema and load it in Visual Studio Code manually?

4 Answers

For me it wasn't the proxy blocking, but trusted domain list in VSCode.

Go to "Manage trusted domains" on Command Palette and add required url. Here we can add "http://json.schemastore.org"

This is whitelist for VSCode, as a security feature, stopping it running code from anywhere from internet.

Update:

Seems a network issue for me. When I set Http: proxy correctly it disappeared and json schema works well.

httpproxysettings

jsonschemaworkfine


Go to "Settings" > "JSON" > "Schema Download" and disabled it.

That's worked for me.

just follow these simple steps

  1. click on the Settings icon at the bottom left of your vscode
  2. search for JSON
  3. you should see the schema download, it should be enabled
  4. just turn it off

This worked for me. The first image was a before

The second image shows the text editor after

Related