I have this strange problem in my VS 2015 project where I'm getting 47,114 compiler errors in Typescript but the program works anyway, and generates the JS file correctly.
Error TS2339 Property 'fromCharCode' does not exist on type 'StringConstructor'. MyProject c:...\Scripts\Autocode.ts 70 Active Error TS2339 Property 'length' does not exist on type 'String'. MyProject c:...\Scripts\Autocode.ts 70 Active Error TS2339 Property 'substr' does not exist on type 'String'. MyProject c:...\Scripts\Autocode.ts 70 Active Error TS2339 Property 'floor' does not exist on type ''. MyProject c:...\Scripts\Autocode.ts 70 Active Error TS2339 Property 'fromCharCode' does not exist on type 'StringConstructor'. MyProject c:...\Scripts\Autocode.ts 70 Active Severity Code Description Project File Line Suppression State Error TS2304 Cannot find name 'number'. MyProject C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\CommonExtensions\Microsoft\TypeScript\lib.d.ts 5925 Active Error TS1005 ';' expected. MyProject C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\CommonExtensions\Microsoft\TypeScript\lib.d.ts 5925 Active Error TS1109 Expression expected. MyProject C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\CommonExtensions\Microsoft\TypeScript\lib.d.ts 5925 Active
47,000 of these types of errors but the program runs well.
How can I correct these errors?
You might not have included es2015 into your tsconfig.json
file:
{
"compilerOptions": {
"lib": ["es2015"]
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With