Questions tagged [tsconfig.json]
21 questions
4
votes
5 answers
the prelaunchtask 'tsc build - tsconfig.json' terminated with exit code 1
I am learning TypeScript on this course. During the course in 'Debugging TypeScript Application' section where Mosh teach how to use debugger in VScode, I was unable to follow along because when I start debugging (F5) this bug occur:
'the…

Suphawat
- 61
- 7
2
votes
2 answers
Specify min/max `tsc` version in tsconfig.json
Is there a way to specify the minimum/maximum version of typescript (tsc compiler) that should be used to compile the project?
{
"compilerOptions": {
"minVersion": '', // ?
"maxVersion": '', // ?
"outDir": "dist",
"strict": true,
…

Alexander Mills
- 90,741
- 139
- 482
- 817
2
votes
0 answers
how can I get all node_modules files that are used in a project by the typescript compiler?
I'm trying to compile a full typescript project using the typescript compiler.
What I got so far is that the files specified in the tsconfig.json file are compiled and available. However, I also want to access the files on which the project files…

Corno
- 5,448
- 4
- 25
- 41
1
vote
0 answers
Cannot find type definition file for 'moment'. The file is in the program because: Entry point for implicit type library 'moment'ts
A brief background of what brought me here:
I formatted the operating system disk.
Reinstalled Windows 10 on my computer.
Installed node/npm through NVM in the version previously used in my project (12.8.0).
Cloned my project from the GitHub…

Sérgio Piacenti
- 11
- 2
1
vote
1 answer
TypeScript bracket notation and dot notation differences with "noImplicitAny": true/false
With "noImplicitAny": true in tsconfig.json:
const a = {}
console.log(a['b']) // Property b does not exist on type {}.
console.log(a.b) // Property b does not exist on type {}.
With "noImplicitAny": false in tsconfig.json:
const a =…

Wenfang Du
- 8,804
- 9
- 59
- 90
1
vote
1 answer
Is autoimport normal in TypeScript?
My TypeScript is up to date. I have two typescripts named first.ts and second.ts . first.ts code is that: let myName: string = 'John Doe'; I can see this variable when I write in second.ts. (Also I can use this variable.
To be honest not just…

Carasidelt
- 47
- 5
1
vote
0 answers
I want to configure tsconfig.json for code that only runs on the server and to throw error when I use window or document object. Is it possible?
I am writing a script to be only run in a node.js (server) environment and not in the browser. What I have noticed is that the typescript compiler auto completes the window and document object as if they would be available. Is there a way to…

Aabhas Dhaubanja
- 29
- 1
- 2
1
vote
0 answers
node.js ERR_IMPORT_ASSERTION_TYPE_MISSING TypeError: Module tsconfig.json needs an import assertion of type "json"
{
"extends": "../../tsconfig.json",
"include": [
"**/*.ts"
],
"exclude": [
"node_modules",
"build"
],
"compilerOptions": {
"baseUrl": ".",
"rootDir": ".",
"outDir": "build/",
…

Kok How Teh
- 3,298
- 6
- 47
- 85
1
vote
1 answer
how I can disable some ngtsc warnings
After I upgraded my Angular application to v15, some warnings started showing in terminal and chrome devtool
Is there any way soI can disable those warnings.
The left side of this optional chain operation does not include 'null' or 'undefined' in…

Rabie Daddi
- 174
- 1
- 2
- 10
0
votes
0 answers
Module not found: Error: Can't resolve './token.did.js' in '/home/name/ic-projects/token/src/declarations/token'
i am new to web3.0 programming. i was making an app of crypto token creation. while i was running the application it was giving an error can't resolve './token.did.js' in '/home/name/ic-projects/token/src/declarations/token' i have imported the…

ankit
- 11
0
votes
1 answer
`types` option in TSConfig doesn't work as stated in the TS docs
I think TSConfig types option doesn't work as stated in the TS docs.
I installed npm packages, express, @types/express, node, @types/node, lodash, @types/lodash and moment.
And i wrote TSConfig like below.
{
"include": ["./main.ts", "./src"],
…

LeeJaeyun
- 11
- 1
0
votes
0 answers
Visual Studio's IntelliSense does not recognize absolute paths when importing modules
I want to use absolute paths rather than relative paths in my Angular application so I updated my tsconfig.json file like so:
"baseUrl": "./",
"paths": {
"@environment/*": [ "./src/environments/*" ],
"@shared/*": [ "./src/app/shared/*"…

Kivo
- 385
- 8
- 24
0
votes
0 answers
Import via absolute paths in Angular 9
I want to remove long and unreadable relative imports in my Angular apps, so I changed my tsconfig.json file by updating the paths section as follow:
{
"compileOnSave": false,
"compilerOptions": {
"downlevelIteration":…

Kivo
- 385
- 8
- 24
0
votes
1 answer
Error: Cannot resolve type entity i2.ExtensionsModule to symbol
I am upgrading Angular 5.x to 15.x.
I have resolved most build errors except this -
./src/main.ts - Error: Module build failed (from ./node_modules/@ngtools/webpack/src/ivy/index.js):
Error: Cannot resolve type entity i2.ExtensionsModule to…

user327126
- 965
- 3
- 11
- 22
0
votes
0 answers
What's wrong with my tsconfig.json? not working with all .tsx files
MyProject code shot
package.json
I create a new project to try typescript. I want to use types checking in both .ts and .tsx files without useing import.
All right with .ts files. But the vscode shows problems with .tsx files.
I don't know what's…