Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?

like image 932
sennder Avatar asked Jul 03 '17 16:07

sennder


People also ask

How do I prettify json in VS Code?

Formatting# You can format your JSON document using Ctrl+Shift+I or Format Document from the context menu.

Where is the settings json file for VS Code?

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.


1 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.

like image 126
guest_user Avatar answered Oct 10 '22 09:10

guest_user