TypeScript: Problems panel lists 4 problems for jsconfig.json in my project

TS Template added by @mjbvz

TypeScript Version: 4.1.5

Search Terms

  • configdiag

  • VS Code Version: 1.53.2
  • OS Version: Windows 10

Steps to Reproduce:

  1. Create a new Gatsby project, or clone from my repo
  2. Open VSCode
  3. Create a new jsconfig.json file if it does not exist
  4. Problems panel will randomly show errors on the jsconfig.json file image

The jsconfig.json file contains this:

{
    "compilerOptions": {
        "module": "commonjs",
        "jsx": "preserve",
        "baseUrl": "./src"
    },
    "include": ["src"],
    "exclude": [
        "node_modules",
        "**/node_modules/*",
        "node_modules/**/*",
        "public"
    ]
}

Does this issue occur when all extensions are disabled?: Yes

About this issue

  • Original URL
  • State: open
  • Created 3 years ago
  • Reactions: 3
  • Comments: 23 (6 by maintainers)

Most upvoted comments

Ok, I’ve moved this to typescript to see if they have any insights.

Here’s the relevant diagnostics that are being generated:

Info 269  [02:01:03.214] event:
    {"seq":0,"type":"event","event":"projectLoadingFinish","body":{"projectName":"c:/Users/LewChan/Documents/Projects/reproduce-jsconfig-error/jsconfig.json"}}
Info 270  [02:01:03.230] event:
    {"seq":0,"type":"event","event":"configFileDiag","body":{"triggerFile":"c:/Users/LewChan/Documents/Projects/reproduce-jsconfig-error/jsconfig.json","configFile":"c:/Users/LewChan/Documents/Projects/reproduce-jsconfig-error/jsconfig.json","diagnostics":[{"text":"File 'c:/Users/LewChan/Documents/Projects/reproduce-jsconfig-error/node_modules/defer-to-connect/dist' not found.","code":6053,"category":"error"},{"text":"File 'c:/Users/LewChan/Documents/Projects/reproduce-jsconfig-error/node_modules/dotenv/types' not found.","code":6053,"category":"error"},{"text":"File 'c:/Users/LewChan/Documents/Projects/reproduce-jsconfig-error/node_modules/tsconfig-paths/lib/index' not found.","code":6053,"category":"error"}]}}

Here is a link to a working solution on stackoverflow The solution requires adding the json schema to vscode JSON Settings https://stackoverflow.com/questions/61287127/vscode-shows-typescript-related-problems-in-jsconfig-json-file#answer-66552275