Questions tagged [vscode-jsconfig]

44 questions
37
votes
6 answers

jsconfig.json gives ts errors

I am having jsconfig.json in my root directory using Nuxt.js project. And I am having an error: File '/home/mike/Documents/nuxt/node_modules/dotenv/types' not found. The file is in the program because: Root file specified for…
Mike K.
  • 637
  • 1
  • 5
  • 18
35
votes
6 answers

How to fix "File '.../node_modules/dotenv/types' not found." error coming from jsconfig.json?

VSCode is showing errors for jsconfig.json: "File '.../node_modules/dotenv/types' not found." Appears to be looking for typescript definitions for dotenv, but I'm not using typescript or dotenv (other than in imported packages). And there is a…
Steve
  • 411
  • 1
  • 5
  • 5
35
votes
5 answers

VSCode jsconfig.json error "node_modules/agent-base/dist/src/index" not found

Why is VSCode showing this error? It's just a jsconfig.json file. NOTE: I'm not using TypeScript.
cbdeveloper
  • 27,898
  • 37
  • 155
  • 336
13
votes
3 answers

Why does VSCode not pick up path aliases in tsconfig?

I had a jsconfig.json which I replaced with a tsconfig.json. Following the replacement, VSCode doesn't pick up path aliases and reports an import error: Example: Cannot find module '@Components/Title' or its corresponding type…
bluprince13
  • 4,607
  • 12
  • 44
  • 91
5
votes
1 answer

I have an error with my jsconfig.json in react js says throw err Unexpected token } in JSON at position

The problem is that when i try to run yarn start then says the error yarn run v1.22.5$ react-app-rewired start internal/modules/cjs/loader.js:1052 throw err; ^ SyntaxError:…
Dario Coronel
  • 119
  • 2
  • 10
5
votes
2 answers

VScode: How to autocomple json/scss/image file paths from shortcut paths specified in jsconfig shortcuts

When doing imports, intellisense will suggest autocompletion names when I am trying to import a React .jsx component. Nothing will be suggested when I am trying to import json or scss files though. I have a set of aliases that I set up in my…
Sam
  • 1,765
  • 11
  • 82
  • 176
4
votes
1 answer

Visual Studio Code Intellisense and Autocomplete - Vite, JSconfig and Aliases - can't figure out the right combination

Just started working again with Visual studio code after years on PHPStorm/Webstorm I've decided to take the transition just because of how lightweight VSCode is and because I don't want to rely on a paid service/having it on every computer since…
Liad Goren
  • 299
  • 1
  • 4
  • 18
4
votes
1 answer

Vue.Js: Alias configurations

I am trying to make aliases for the components and sub-directories using jsconfig.json in my Vue.js project. But I am getting this error: jsconfig.json { "compilerOptions": { "baseUrl": ".", "paths": { …
Mr.Singh
  • 1,421
  • 6
  • 21
  • 46
4
votes
2 answers

set jsconfig.json in a VueJS project

Vue js 2.6.X, create with Vue-Cli 4.5.X using vue create name I've added a jsconfig.json inside the root folder "compilerOptions": { "module": "commonjs", "target": "es6", "baseUrl": ".", "paths": { "@/*": ["./src/*"], …
Liad Goren
  • 299
  • 1
  • 4
  • 18
3
votes
0 answers

Auto Imports in VSCode using React not working

I have an issue and don't know the reason or how to fix it. VS Code doesn't underline the incorrect path for imports in case if they are wrong. Also the auto import does not work. I tried to setup a jsconfig file to use the absolute paths, but…
3
votes
2 answers

Eslint doesn't respect jsconfig paths

I have my express.js project in monorepo. I want to add custom path alias to it. The directory structure is: ./ server/ ----> jsconfig.json ----> .eslintrc.js ----> src/ --------> index.js --------> modules/auth ------------->…
natikos
  • 111
  • 9
3
votes
1 answer

Import module with absolute path using jsconfig.json not working in Node JS

It is difficult to refer the modules using relative path in the project. To achieve this we tried to using jsconfig.json on the client (react) project to refer from the absolute path. Below is my jsconfig.json file. It is working fine. { …
Nandy
  • 666
  • 1
  • 12
  • 27
2
votes
0 answers

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…
Hazy
  • 1,766
  • 2
  • 8
  • 12
2
votes
1 answer

I'm trying to setup jsconfig.json but i get this error

Help I got this error when try to setup jsconfig.json, how to solve this problem? this my jsconfig.json : { "compilerOptions": { "module": "commonjs", "target": "es6", "sourceMap": true, "baseUrl": ".", "paths": { …
2
votes
1 answer

jsconfig.json error: "node_modules/html-entities/lib/index" not found

This is my jsconfig.json file: { "compilerOptions": { "baseUrl": ".", "target": "es6", "module": "commonjs", "paths": { "@analytics/*": ["./src/analytics/*"], "@assets/*": ["./src/assets/*"], …
cbdeveloper
  • 27,898
  • 37
  • 155
  • 336
1
2 3