question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

jsconfig in VSCode as described in docs doesn't work

See original GitHub issue

Current behavior:

I think your docs need some modifications. Currently, in IDE Integration, setting up a jsconfig.json file is mentioned as an alternative way to make Intellisense work in VSCode (instead of adding triple slash directives). But it won’t work. In my case I needed a tsconfig.json with a "types": ["cypress"] prop under "compilerOptions".

Desired behavior:

I think that “(like VS Code)” in “Reference type declarations via jsconfig” should be removed, since it doesn’t work in that editor. And may cause confusion. Instead it’d better to put it under “Reference type declarations via tsconfig”.

Versions

Cypress 4.8.0 VSCode 1.47.3 Ubuntu 18.04.4 LTS

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:9 (2 by maintainers)

github_iconTop GitHub Comments

7reactions
luanorlandicommented, Dec 21, 2020

Thank you for sharing your resolution @mrmowji

Same thing here, the relative path in includes with ./node_modules/cypress and compilerOptions with alias path didn’t work together, but when isolated, they work fine. Changing to node_modules/cypress, they work together. I also noticed that if adding "src/**/*" in includes, they all work together, even if it’s using relative path ./node_modules/cypress.

Here is my configuration in case anyone ends up with this problem:

Initial jsconfig.json (from Cypress docs):

{
  "include": [
    "./node_modules/cypress",
    "cypress/**/*.js"
  ]
}

Then changed to this:

{
  "include": [
    "node_modules/cypress",
    "cypress/**/*.js",
    "src/**/*"
  ],
  "compilerOptions": {
    "baseUrl": ".",
    "paths": {
      "@/*": [
        "src/*"
      ]
    }
  }
}
1reaction
jeffnymancommented, Feb 8, 2022

I have to agree with the above poster. I’m in the same boat with this in terms of jsconfig.json showing an error in VS Code. I used the solution as provided above but I get the error: “JSON schema for a JavaScript project using TypeScript tooling.”

I have done nothing with the project except set it up via the following commands:

  • npm init -y
  • npm install cypress
  • npx cypress open

That’s it. From there I added the jsconfig.json file and put the above suggested contents in place. Everything (to my knowledge) is JavaScript; I’m not sure why “TypeScript tooling” is being indicated.

So far I’m getting a lot of field reports from classrooms that they are experiencing the exact same thing.

Read more comments on GitHub >

github_iconTop Results From Across the Web

jsconfig in VSCode as described in docs doesn't work #3063
Currently, in IDE Integration, setting up a jsconfig.json file is mentioned as an alternative way to make Intellisense work in VSCode (instead ...
Read more >
jsconfig.json Reference - Visual Studio Code
jsconfig.json. What is jsconfig.json? The presence of jsconfig.json file in a directory indicates that the directory is the root of a JavaScript Project....
Read more >
VSCode jsconfig.json error "node_modules/agent-base/dist ...
Try adding "exclude": ["node_modules"] as described in the VSCode docs. I added this and restarted VSCode and the error message went away.
Read more >
IDE Integration - Cypress Documentation
You can choose to open it in your: File system (e.g. Finder on MacOS, File Explore on Windows); An IDE located on your...
Read more >
How to Set Up VS Code for React Development - SitePoint
Implementing the tools and techniques listed in this article will probably save you hours of development work — hours that would have been ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found