Definitelytyped: types/react/index.d.ts(191,27): error TS1005: ',' expected

Created on 24 Jun 2017  路  4Comments  路  Source: DefinitelyTyped/DefinitelyTyped

manjula@sat850:/msystem/workspace/m-app_v7$ tsc -v
Version 2.3.4

[email protected] start /msystem/workspace/m-app_v7
tsc && concurrently "tsc -w" "lite-server"

node_modules/@types/react/index.d.ts(191,27): error TS1005: ',' expected.
node_modules/@types/react/index.d.ts(191,29): error TS1005: '>' expected.
node_modules/@types/react/index.d.ts(191,31): error TS1128: Declaration or statement expected.
node_modules/@types/react/index.d.ts(191,41): error TS1109: Expression expected.
node_modules/@types/react/index.d.ts(212,27): error TS1005: ',' expected.
node_modules/@types/react/index.d.ts(212,29): error TS1005: '>' expected.
node_modules/@types/react/index.d.ts(212,31): error TS1128: Declaration or statement expected.
node_modules/@types/react/index.d.ts(212,41): error TS1109: Expression expected.
node_modules/@types/react/index.d.ts(214,34): error TS1005: ',' expected.
node_modules/@types/react/index.d.ts(214,36): error TS1005: '>' expected.
node_modules/@types/react/index.d.ts(214,38): error TS1128: Declaration or statement expected.
node_modules/@types/react/index.d.ts(214,48): error TS1109: Expression expected.

Most helpful comment

See #17288
You need to upgrade to TypeScript 2.3+ to use the latest types/react/index.d.ts
Edit:
There is something wrong in your TypeScript setup, otherwise interface Component<P = {}, S = {}> line 191 would be recognized.

All 4 comments

See #17288
You need to upgrade to TypeScript 2.3+ to use the latest types/react/index.d.ts
Edit:
There is something wrong in your TypeScript setup, otherwise interface Component<P = {}, S = {}> line 191 would be recognized.

@tkrotoff
I had the exact same issue (with the same errors when building) and upgraded my global install of typescript (it was version 2.2.0) that fixed the issues I was having...

>npm list -g --depth=0
+-- [email protected]
+-- [email protected]
-- [email protected]

the above command will show you your global version of typescript

then I ran the following command to update typescript globally

>npm update -g typescript
-- [email protected]

Please ignore this issue, raised an issue at npm

Greetings... Got similar issue with angular/index.d.ts.
This happened after I deleted node_modules folder and did 'npm install'
Interestingly, it happens only when 'npm start' is run. But does not happen when tsc is issued on command line.
For the time being I replaced index.d.ts with an old copy I had and it worked.
Any help will be appreciated..Please find the details attached:
image

the error was similar whe i try to run: ionic cordova build android --prod

[09:53:18] typescript: C:/Projetos/app/node_modules/@types/q/index.d.ts, line: 200
',' expected.

 L199:  * Returns a promise that will have the same result as promise, except that if promise is not fulfilled or rejected
 L200:  * before ms milliseconds, the returned promise will be rejected with an Error with the given message. If mes
 L201:  * is not supplied, the message will be "Timed out after " + ms + " ms".

Solution:

Change typescript version from 2.2.2 to 2.3.4 on package.json

Was this page helpful?
0 / 5 - 0 ratings