Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why am I getting error in tsconfig when I install React TS from Vite?

I have installed React TS in Vite, but it is showing me an error in tsconfig.json. I can't figure out why because I haven't even tried to change the installed code yet. What is the reason?

[tsconfig.json ](https://i.sstatic.net/obFT4.png)

> 1. error: Specify how TypeScript looks up a file from a given module specifier.
>
> See more: [https://www.typescriptlang.org/tsconfig#moduleResolution](https://www.typescriptlang.org/tsconfig#moduleResolution)
>
> vscode-file://vscode-app/c:/Users/User/AppData/Local/Programs/Microsoft%20VS%20Code/resources/app/out/vs/code/electron-sandbox/workbench/workbench.html
>
> Option '--resolveJsonModule' cannot be specified without 'node' module resolution strategy.
>
> 2. error: Allow imports to include TypeScript file extensions. Requires '--moduleResolution bundler' and either '--noEmit' or '--emitDeclarationOnly' to be set.
>
> 3. error: Enable importing .json files
like image 945
Bahriddin Avatar asked Jan 31 '26 08:01

Bahriddin


2 Answers

Try changing the typescript version in your vs code to "Use workspace version" like that

like image 61
Artem Avatar answered Feb 03 '26 04:02

Artem


Adding the settings.json fix, which is in effect the same as the the top fix

This can be resolved by adding the following to your settings.json inside of your .vscode folder

{
  "typescript.tsdk": "node_modules/typescript/lib"
}
like image 26
Savion Sweeney Avatar answered Feb 03 '26 05:02

Savion Sweeney



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!