Fix: “Comments are not permitted in JSON” error in VS Code

Sometimes we need to use comments in a JSON file in the VS Code editor.

But VS Code doesn’t like that.

It throws this error.

image

Here’s how to fix that error:

  1. Click on “JSON” on your status bar at the bottom of your VS Code editor
  2. a menu appears near the search bar up above.
  3. click on ‘Configure File Association for ‘.json’…
  4. Type “JSONC” and choose “JSON with Comments” option.
  5. That’s all! Your error underlinings would now be gone.
image 1
image 2

Comments

No comments yet. Why don’t you start the discussion?

Leave a Reply

Your email address will not be published. Required fields are marked *

15 − 2 =