Definitelytyped: tsc compilation error

Created on 19 Sep 2019  路  4Comments  路  Source: DefinitelyTyped/DefinitelyTyped

Below are the errors I get using tsc version 3.6.3

node_modules/@types/chai/index.d.ts:121:9 - error TS8020: JSDoc types can only be used inside documentation comments.

121 any?, // actual value
~~~~

node_modules/@types/chai/index.d.ts:122:9 - error TS8020: JSDoc types can only be used inside documentation comments.

122 boolean? // showDiff
~~~~

node_modules/@types/chai/index.d.ts:126:16 - error TS2370: A rest parameter must be of an array type.

126 assert(...args: AssertionArgs): void;

Most helpful comment

Okay I found the error for me, maybe it helps someone else:
The Typescript feature used in these lines (optional elements in tuple types) is pretty new and so old Typescript versions don't know it. So I removed ts-node and typescript from my package.json and reinstalled the newest version, now the error is gone
New entries in package.json:
"ts-node": "^8.4.1", "typescript": "^3.6.3"

So @jugmabora maybe you should check if you are really using the Typescript version you mentioned above or if there is an old version hanging around

In addition I had a problem with two missing types, the fix for that was to change the Typescript target to "es2015"

All 4 comments

Same for me

Okay I found the error for me, maybe it helps someone else:
The Typescript feature used in these lines (optional elements in tuple types) is pretty new and so old Typescript versions don't know it. So I removed ts-node and typescript from my package.json and reinstalled the newest version, now the error is gone
New entries in package.json:
"ts-node": "^8.4.1", "typescript": "^3.6.3"

So @jugmabora maybe you should check if you are really using the Typescript version you mentioned above or if there is an old version hanging around

In addition I had a problem with two missing types, the fix for that was to change the Typescript target to "es2015"

Same for me

I also had this problem. I resolved it by updating typescript globally.
sudo npm install -g typescript@latest
https://stackoverflow.com/questions/39677437/how-to-update-typescript-to-latest-version-with-npm

Was this page helpful?
0 / 5 - 0 ratings

Related issues

JWT
svipas picture svipas  路  3Comments

variousauthors picture variousauthors  路  3Comments

jrmcdona picture jrmcdona  路  3Comments

alisabzevari picture alisabzevari  路  3Comments

victor-guoyu picture victor-guoyu  路  3Comments