Skip to content

Instantly share code, notes, and snippets.

@oyvindym
Created April 11, 2018 06:56
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save oyvindym/ebd63bfa21fa5b07a9b31b2a4a5b3655 to your computer and use it in GitHub Desktop.
Save oyvindym/ebd63bfa21fa5b07a9b31b2a4a5b3655 to your computer and use it in GitHub Desktop.
How to resolve TS2717 error with declaration collision between dependencies

Resolving declaration collision between dependencies

Getting a flood of TS2717 Typescript errors when running your application?

Deleting the @types-package mentioned in the logs from the node-modules/@types folder and upgrading it again using yarn should solve the problem.

Example

@types/react-redux is complaining about subsequent property declarations (see logs below).

This can be fixed with the following commands.

$ rm -r node_modules/@types/react-redux
$ yarn upgrade @types/react-redux -E -D

Output from running application:

ERROR in [at-loader] ./node_modules/@types/react-redux/node_modules/@types/react/index.d.ts:3918:13
    TS2717: Subsequent property declarations must have the same type.  Property 'textPath' must be of type 'SVGProps<SVGTextPathElement>', but here has type 'SVGProps<SVGTextPathElement>'.

ERROR in [at-loader] ./node_modules/@types/react-redux/node_modules/@types/react/index.d.ts:3919:13
    TS2717: Subsequent property declarations must have the same type.  Property 'tspan' must be of type 'SVGProps<SVGTSpanElement>', but here has type 'SVGProps<SVGTSpanElement>'.

ERROR in [at-loader] ./node_modules/@types/react-redux/node_modules/@types/react/index.d.ts:3921:13
    TS2717: Subsequent property declarations must have the same type.  Property 'use' must be of type 'SVGProps<SVGUseElement>', but here has type 'SVGProps<SVGUseElement>'.

ERROR in [at-loader] ./node_modules/@types/react-redux/node_modules/@types/react/index.d.ts:3921:13
    TS2717: Subsequent property declarations must have the same type.  Property 'view' must be of type 'SVGProps<SVGViewElement>', but here has type 'SVGProps<SVGViewElement>'.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment