Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

219
Views
Whenever I use jsconfig.json in a react project + VS Code to set up paths/alias's I lose the ability to cmd+click on an import to go to that file

So I have started adding a jsconfig.json file to my react projects in VS Code to enable me to use imports like:

import { Home, Expenses, Invoices } from '@/views';

instead of:

import { Home, Expenses, Invoices } from '../views';

My jsconfig file looks like this:

{
  "compilerOptions": {
    "module": "commonjs",
    "baseUrl": "src",
    "paths": {
      "@/*": ["/*"],
      "@/components/*": ["/components/*"],
      "@/views/*": ["/views/*"],
      "@/styles/*": ["/styles/*"]
    }
  },
  "include": ["src"],
  "exclude": ["node_modules"]
}

However one thing I have started to notice, is that whenever I do this I can no longer click on 'Home' say and be taken to the code/file. Instead it always brings up a popover that just shows references to the file. Nothing I click on within this reference popover will take me to the file. It looks like this:

popover example

Sometimes it doesn't even bring up the hover. It will just select the element in the open code block, if I click on the element it will just select the import at the top.

If I remove the '@' sign then everything works as intended.

Is there any way to use a jsconfig.json file with absolute imports/path alias' AND keep the ability to click on the import to go the file/code.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!