#Typescript stuck during compilation

20 messages · Page 1 of 1 (latest)

thick palm
#

I have a project using typescript (It's discord bot but shouldn't be relevant) and when I try to compile the TSC commands never seems to finish. I tried understanding why I wasn't working so after a bit I found a file in my project that is causing the issue and the only way I found to get the TSC command to ever finish is by adding an as any or any other type that would cause an error where I use a param typed as the keyof of an interface and used to access a value from an object using the [<variable>] syntax (I have the noImplicitAny option enabled and when an invalid key is used for accessing proprieties with [<prop>] it gives the return type any), but if I don't any any as or any kind of casing then the compiler get stuck during compilation and I don't get any kind of warning/error

also, visual studio code can't load the intellisense caused by the TS-Server also getting stuck during analyzing of the code i guess

vast sedge
#

weird
are you sure your project is configured correctly?

#

happened to me in the past that if I didn't have a tsconfig.json in my root folder, tsc would look for one in the parent folders, recursively
and find huge amounts of code in other folders, and try to compile them (which made tsc hand and take lots of memory)

thick palm
vast sedge
#

yeah, you can always send it here

#

at least we can make sure it's correct

thick palm
#

The skipLibCheck i put it to false just to check, i have a .d.ts file, but it doesn't seems to change much

near tapir
#

I hate phones for json files

thick palm
#

one moment that i try to fix them

vast sedge
vast sedge
thick palm
vast sedge
#

it's only about checking if your dependencies' typings are correct

#

most of the time you can simply assume they are, so that's why that option exists

#

does not mean those typings won't be taken into account
just won't be checked for types declared multiple times, etc.

thick palm
#

out of curiosity i fixed the error i got for my .d.ts file, but it does not help