We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I use ntypescript in webpack, mostly for 3rd party libraries. Recently I have added react to my project and started to get errors for @types/react:
react
@types/react
ERROR in /Users/korya/dev/superapp/node_modules/@types/react/index.d.ts (171,34): error TS1005: ',' expected. ERROR in /Users/korya/dev/superapp/node_modules/@types/react/index.d.ts (172,34): error TS1005: ',' expected. ERROR in /Users/korya/dev/superapp/node_modules/@types/react/index.d.ts (2636,43): error TS1005: ']' expected. ERROR in /Users/korya/dev/superapp/node_modules/@types/react/index.d.ts (2636,44): error TS1005: ';' expected. ERROR in /Users/korya/dev/superapp/node_modules/@types/react/index.d.ts (2636,45): error TS1128: Declaration or statement expected. ERROR in /Users/korya/dev/superapp/node_modules/@types/react/index.d.ts (2636,46): error TS1128: Declaration or statement expected. ERROR in /Users/korya/dev/superapp/node_modules/@types/react/index.d.ts (2636,61): error TS1005: '(' expected. ERROR in /Users/korya/dev/superapp/node_modules/@types/react/index.d.ts (2695,1): error TS1128: Declaration or statement expected.
The problematic source code lines (causing the first error) are:
// Base component for plain JS classes class Component<P, S> implements ComponentLifecycle<P, S> { constructor(props?: P, context?: any); setState<K extends keyof S>(f: (prevState: S, props: P) => Pick<S, K>, callback?: () => any): void; ▲ The error points here setState<K extends keyof S>(state: Pick<S, K>, callback?: () => any): void; ▲ ... and here forceUpdate(callBack?: () => any): void; render(): JSX.Element | null;
Is it caused by the fact that the type definition uses some syntax/features introduced in Typescript 2.2? Is there a workaround?
The text was updated successfully, but these errors were encountered:
Just upgraded @types/lodash and got similar errors:
@types/lodash
ERROR in /Users/korya/dev/superapp/node_modules/@types/lodash/index.d.ts (11587,21): error TS1005: ']' expected. ERROR in /Users/korya/dev/superapp/node_modules/@types/lodash/index.d.ts (11587,22): error TS1005: ';' expected. ERROR in /Users/korya/dev/superapp/node_modules/@types/lodash/index.d.ts (11587,23): error TS1128: Declaration or statement expected. ERROR in /Users/korya/dev/superapp/node_modules/@types/lodash/index.d.ts (11587,33): error TS1005: ']' expected. ERROR in /Users/korya/dev/superapp/node_modules/@types/lodash/index.d.ts (11587,34): error TS1005: ')' expected. ERROR in /Users/korya/dev/superapp/node_modules/@types/lodash/index.d.ts (11587,35): error TS1128: Declaration or statement expected. ERROR in /Users/korya/dev/superapp/node_modules/@types/lodash/index.d.ts (11587,37): error TS1128: Declaration or statement expected. ERROR in /Users/korya/dev/superapp/node_modules/@types/lodash/index.d.ts (19580,1): error TS1128: Declaration or statement expected. ERROR in /Users/korya/dev/superapp/node_modules/@types/lodash/index.d.ts (241,13): error TS2300: Duplicate identifier '_'. ERROR in /Users/korya/dev/superapp/node_modules/@types/lodash/index.d.ts (245,19): error TS2300: Duplicate identifier '_'.
The problematic source code (causing the first error):
type ConformsPredicateObject<T> = { [P in keyof T]: (val: T[P]) => boolean; ▲ The error points here };
Sorry, something went wrong.
No branches or pull requests
I use ntypescript in webpack, mostly for 3rd party libraries. Recently I have added
react
to my project and started to get errors for@types/react
:The problematic source code lines (causing the first error) are:
Is it caused by the fact that the type definition uses some syntax/features introduced in Typescript 2.2? Is there a workaround?
The text was updated successfully, but these errors were encountered: