Skip to content

Problems panel lists 4 problems for jsconfig.json in my project #42840

Open

Description

@lwschan

TS Template added by Matt Bierner (@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

Activity

  1. gjsjohnmurray commented on Feb 12, 2021

    @gjsjohnmurray

    /needsMoreInfo

    Please run the Extension Bisect command to determine whether these are coming from an extension you added (you didn't list these in your report). If Bisect identifies an extension, report the issue to the extension author. The "Report Issue" dialog on the "Help" menu can assist with that. Then close this issue, and optionally link it to the one you created on the extension's repository.

  2. vscode-triage-bot commented on Feb 12, 2021

    @vscode-triage-bot

    Thanks for creating this issue! We figured it's missing some basic information or in some other way doesn't follow our issue reporting guidelines. Please take the time to review these and update the issue.

    Happy Coding!

  3. lwschan commented on Feb 12, 2021

    @lwschan
    Author

    Hi John Murray (@gjsjohnmurray)

    I just ran it with Extension Bisect, and the issue is still there.

    image

  4. gjsjohnmurray commented on Feb 12, 2021

    @gjsjohnmurray

    /assign Matt Bierner (@mjbvz) - is this one for you, seeing as the problems appear to be reported by the builtin ts extension?

  5. mjbvz commented on Feb 12, 2021

    @mjbvz
    Contributor

    Please provide a minimal sample project and specific steps to reproduce the problem

  6. lwschan commented on Feb 13, 2021

    @lwschan
    Author

    Hi Matt Bierner (@mjbvz)

    You can use the project I in first comment. just create a new .js file inside src folder, that is already good enough to trigger the problem to appear. Or do you need something more simple than that?

    In the repo I shared, you can use the branch "reboot" to reproduce the problem.

    1. Run yarn install after checkout to reboot branch
    2. If VSCode is already open, restart it
    3. Create a new folder in components
    4. Create a new file, with the same folder name

    Then the problems will pop up. If creating 1 file does not trigger it, you can create more files in the folder you have created, or create new folders and new files to trigger it.

  7. mjbvz commented on Feb 17, 2021

    @mjbvz
    Contributor

    Please provide a minimal project. The project you linked to is quite large and this type of bug is often a project configuration issue. It's not a good use of our time to try debugging through it

  8. lwschan commented on Feb 17, 2021

    @lwschan
    Author

    Thanks the for reply, Matt Bierner (@mjbvz)

    I will try to provide one.

    I actually specifically mentioned the reboot branch, because that branch is new, and it only has the bare minimum Gatsby startup code, with Airbnb's ESLint packages.

    If you look at the main vs reboot, you will find that reboot is much smaller.

  9. lwschan commented on Feb 17, 2021

    @lwschan
    Author

    Hi Matt Bierner (@mjbvz)

    I have been able to reliably reproduce the problem using this new minimal project - lewisgauss/reproduce-jsconfig-error

    I also have a much simpler way to reproduce it.

    1. Open the project
    2. Open any .js file, like pages/index.js
    3. Open jsconfig.json
    4. In jsconfig.json, edit it you can remove one line, like jsx: "preserve"
    5. Click on the .js file that you opened, so Visual Studio Code can reinitialize the feature
    6. Click on jsconfig.json again, add the line that you just removed back
    7. Click on the .js file again, the problems will now show in the panel

    I hope this helps!

  10. mjbvz commented on Feb 17, 2021

    @mjbvz
    Contributor

    I followed those steps but this does not reproduce for me in VS Code insiders with extensions disabled

  11. lwschan commented on Feb 17, 2021

    @lwschan
    Author

    Matt Bierner (@mjbvz) did you do npm install before going through the steps?

    You also have to wait for the initializing JS/TS feature to finish in between steps.
    image

    I have just tried this on a completely different computer, and I could reproduce it. (macOS and Windows 10) With all extensions disabled. :)

    image

  12. lwschan commented on Feb 17, 2021

    @lwschan
    Author

    Another run with Extension Bisect.

    image

  13. mjbvz commented on Feb 17, 2021

    @mjbvz
    Contributor

    Yes node modules are installed and initialization is done.

    1. Does node_modules\defer-to-connect\dist\index.d.ts exist and are there any errors in it?
    2. If it does, then please record a video showing the exact steps you are taking here so I can try to match them
  14. lwschan commented on Feb 17, 2021

    @lwschan
    Author

    Hi Matt Bierner (@mjbvz) , yes, the file is there, and TSLint does not show any error. You can see it from the recording below, which shows the reproducible steps and the file without error.

    screen-capture.mp4
  15. mjbvz commented on Feb 17, 2021

    @mjbvz
    Contributor

    Thanks but I am still not able to reproduce following those steps. Can you try collecting the logs from reproducing this:

    1. Set "typescript.tsserver.log": "verbose",
    2. Restart VS Code and reproduce the problem
    3. In VS Code, run the TypeScript: Open TS Server log command
    4. This should open a large log file called tsserver.log

    ⚠️Warning: The TypeScript log may include information from your workspace, including file paths and source code. If you have any concerns about posting this publicly on Github, just let me know and we can arrange something else. On our side, we only use these logs to investigate issues like this

  16. lwschan commented on Feb 17, 2021

    @lwschan
    Author

    Hello again, Matt Bierner (@mjbvz)

    The file is available here. Hope this helps!

  17. removed their assignment
    on Feb 17, 2021
  18. mjbvz commented on Feb 17, 2021

    @mjbvz
    Contributor

    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"}]}}
    
  19. Tarrowren commented on Oct 18, 2021

    @Tarrowren

    many modules simplify the path of types

    1

    package.json

    {
      "types": "dist"
    }

    fix it

    package.json

    {
      "types": "dist/index.d.ts"
    }

    or exclude this module

    jsconfig.json

    "typeAcquisition": {
      "exclude": ["defer-to-connect"]
    }

    but this is not the perfect solution

  20. tunjioye commented on Oct 22, 2021

    @tunjioye
  21. lwschan commented on Oct 30, 2021

    @lwschan
    Author

    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

    I tried this, sadly it doesn't work for me.

  22. tunjioye commented on Oct 30, 2021

    @tunjioye

    LewisGauss Restart your VS Code after updating the JSON Schema Settings to confirm.

  23. lwschan commented on Oct 31, 2021

    @lwschan
    Author

    LewisGauss Restart your VS Code after updating the JSON Schema Settings to confirm.

    Yeah, I did that, but the error comes back after I add a new JS file.

  24. tunjioye commented on Oct 31, 2021

    @tunjioye

    LewisGauss Restart your VS Code after updating the JSON Schema Settings to confirm.

    Yeah, I did that, but the error comes back after I add a new JS file.

    Okay

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Needs InvestigationThis issue needs a team member to investigate its status.

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions