Skip to content
New issue

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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Definition conflict error on TS v4.2 when ts-toolbelt is installed with a package that depends on a different version of ts-toolbelt #167

Closed
brettmitchelldev opened this issue Dec 25, 2020 · 1 comment
Labels
bug Something isn't working

Comments

@brettmitchelldev
Copy link

馃悶 Bug Report

Describe the bug

Compile error on Typescript 4.2 with latest published ts-toolbelt (8.0.7) when installed alongside @types/ramda@0.27.6.
It appears that you cannot use an up-to-date version of ts-toolbelt with any other library that depends on a different version.

Reproduce the bug

Make new Node.js project and run:

npm i typescript ts-toolbelt ramda @types/ramda
touch index.ts

index.ts:

import { Function } from 'ts-toolbelt';
// Simple custom curry function to consume something from ts-toolbelt.
export const curry = <Fn extends (...args: any[]) => any> (fn: Fn): Function.Curry<Fn> => _curryInternal (fn);

Run:

npx tsc

Output:

node_modules/@types/ramda/node_modules/ts-toolbelt/out/index.d.ts:1:1 - error TS6200: Definitions of the following identifiers conflict with those in another file: Iteration, RawMap, BoundMap, Keys, Map, CreateMap, MapKeys, NumberMap, Next, List, Prepend, Number, IterationOf, Cast, Formats, Way, Format, Key, Extends, __Repeat, _Repeat, Repeat, Equals, Modx, Depth, MergeStyle, Anyfy, Errors, Numeric, Textual, Arrays, Maps, Structures, Abstractions, WebAssembly, BuiltInObject, ComputeRaw, ComputeFlat, ComputeDeep, Compute, Boolean, True, False, Pass, Fail, __Pick, _Pick, Pick, Union, Exclude, _Omit, Omit, AtBasic, AtStrict, AtLoose, At, KnownIterationMapKeys, NegativeIterationKeys, PositiveIterationKeys, NeutralIterationKeys, Numbers, Pos, _NumberOf, NumberOf, Length, Overwrite, Naked, __Reverse, _Reverse, Reverse, Concat, Append, PickIfEntry, ___ListOf, __ListOf, _ListOf, ListOf, Not, Has, ArrayEntry, ArrayProps, Clean, Contains, Match, _Promise, Is, And, Or, IsStringLiteral, IsNumberLiteral, Kind, IsLiteral, _Kind, Promise, Promisable, Try, Type, x, ObjectOf, BooleanOf, Xor, Class, InstanceOf, Parameters, _UnionOf, UnionOf, Prev, _IncludesDeep, IncludesDeep, Mode, Input, ComposeMultiSync, ComposeMultiAsync, ComposeListSync, ComposeListAsync, Tail, Last, Head, Return, IntersectOf, ComposeFnSync, ComposeFnAsync, Composer, Composed, Compose, NonNullable, LibStyle, PatchProp, __PatchFlat, _PatchFlat, PatchFlat, __PatchDeep, ChoosePatchDeep, _PatchDeep, PatchDeep, Patch, NonNullableFlat, NonNullableDeep, NonNullablePart, _NonNullable, GapOf, _GapsOf, GapsOf, Gaps, Curry, NoInfer, PipeMultiSync, PipeMultiAsync, PipeListSync, PipeListAsync, PipeFnSync, PipeFnAsync, Piper, Piped, Pipe, Promisify, UnCurry, Function, PixelMap, Pixel, Primitive, Value, Array, Object, JSON, _IsNegative, IsNegative, _MinusPositive, MinusPositive, _MinusNegative, MinusNegative, _Minus, __Minus, Minus, _Negate, Negate, _Absolute, Absolute, _IsZero, IsZero, _IsPositive, IsPositive, _Greater, Greater, _GreaterEq, GreaterEq, _Lower, Lower, LowerEq, UnionizeCumulatedNumberUnions, FindMaxNumberInUnion, Max, Min, _PlusPositive, PlusPositive, _PlusNegative, PlusNegative, _Plus, __Plus, Plus, RangeForth, RangeBack, __Range, _Range, Range, _OptionalKeys, OptionalKeys, MergeProp, __MergeFlat, _MergeFlat, MergeFlat, __MergeDeep, ChooseMergeDeep, _MergeDeep, MergeDeep, Merge, MergeObject, MergeList, LastIndex, OmitObject, OmitList, PickObject, PickList, ReadonlyFlat, ReadonlyDeep, ReadonlyPart, _Readonly, Readonly, ReadonlyObject, ReadonlyArrays, Record, _Update, Update, _Record_RR, _Record_RW, _Record_OR, _Record_OW, __Assign, _Assign, Assign, RequiredFlat, RequiredDeep, RequiredPart, _Required, Required, OptionalFlat, OptionalDeep, OptionalPart, _Optional, Optional, RequiredIfKeys, __AtLeast, _AtLeast, AtLeast, CompulsoryFlat, CompulsoryDeep, CompulsoryPart, _Compulsory, Compulsory, _CompulsoryKeys, CompulsoryKeys, _ExcludeMatch, ExcludeMatch, ExcludeKeys, Diff, _Strict, Strict, __Either, EitherStrict, EitherLoose, _Either, Either, _FilterKeys, FilterKeys, Filter, __Path, _Path, Path, HasPath, _SelectKeys, SelectKeys, Includes, Intersect, _IntersectMatch, IntersectMatch, IntersectKeys, _Invert, Invert, __MergeAll, _MergeAll, MergeAll, Replace, Modify, _NonNullableKeys, NonNullableKeys, Nullable, NullableFlat, NullableDeep, NullablePart, _Nullable, _NullableKeys, NullableKeys, Partial, __PatchAll, _PatchAll, PatchAll, __Paths, _Paths, Paths, UpdateFlat, __UpdateDeep, _UpdateDeep, UpdateDeep, ValidatePath, __PathValid, _PathValid, PathValid, _ReadonlyKeys, ReadonlyKeys, _Replace, _RequiredKeys, RequiredKeys, Select, UndefinableFlat, UndefinableDeep, UndefinablePart, _Undefinable, Undefinable, _UndefinableKeys, UndefinableKeys, Unionize, WritableFlat, WritableDeep, WritablePart, _Writable, Writable, _WritableKeys, WritableKeys, P, String, DropForth, DropBack, __Drop, _Drop, Drop, KeySet, Extract, UnNestLoose, Flatter, UnNestStrict, __UnNest, _UnNest, UnNest, __Flatten, _Flatten, Flatten, TakeForth, TakeBack, __Take, _Take, Take, __Group, _Group, Group, Longest, _NonNullableDeep, Pop, Remove, Shortest, __Zip, _Zip, Zip, __ZipObj, _ZipObj, ZipObj, _Merge, Test, A, Any, B, C, Community, F, I, L, M, Misc, N, O, S, T, Tuple, U

1 declare module "Iteration/Iteration" {
  ~~~~~~~

  node_modules/ts-toolbelt/out/index.d.ts:1:1
    1 declare module "Iteration/Iteration" {
      ~~~~~~~
    Conflicts are in this file.

node_modules/@types/ramda/node_modules/ts-toolbelt/out/index.d.ts:600:52 - error TS2314: Generic type 'ComputeDeep' requires 1 type argument(s).

600         [K in keyof A]: A[K] extends Seen ? A[K] : ComputeDeep<A[K], A[K] | Seen>;
                                                       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

node_modules/@types/ramda/node_modules/ts-toolbelt/out/index.d.ts:1725:22 - error TS2428: All declarations of 'Function' must have identical type parameters.

1725     export interface Function<P extends List = any, R extends any = any> {
                          ~~~~~~~~

node_modules/@types/ramda/node_modules/ts-toolbelt/out/index.d.ts:3344:9 - error TS2374: Duplicate string index signature.

3344         [k: string]: Value;
             ~~~~~~~~~~~~~~~~~~~

node_modules/@types/ramda/node_modules/ts-toolbelt/out/index.d.ts:4695:45 - error TS2344: Type '"implements->"' does not satisfy the constraint 'Match'.

4695         'implements->': ExcludeMatch<O, O1, 'implements->'>;
                                                 ~~~~~~~~~~~~~~

node_modules/@types/ramda/node_modules/ts-toolbelt/out/index.d.ts:4698:45 - error TS2344: Type '"<-implements"' does not satisfy the constraint 'Match'.

4698         '<-implements': ExcludeMatch<O, O1, '<-implements'>;
                                                 ~~~~~~~~~~~~~~

node_modules/@types/ramda/node_modules/ts-toolbelt/out/index.d.ts:5014:47 - error TS2344: Type '"implements->"' does not satisfy the constraint 'Match'.

5014         'implements->': IntersectMatch<O, O1, 'implements->'>;
                                                   ~~~~~~~~~~~~~~

node_modules/@types/ramda/node_modules/ts-toolbelt/out/index.d.ts:5017:47 - error TS2344: Type '"<-implements"' does not satisfy the constraint 'Match'.

5017         '<-implements': IntersectMatch<O, O1, '<-implements'>;
                                                   ~~~~~~~~~~~~~~

node_modules/ts-toolbelt/out/index.d.ts:1:1 - error TS6200: Definitions of the following identifiers conflict with those in another file: Iteration, RawMap, BoundMap, Keys, Map, CreateMap, MapKeys, NumberMap, Next, List, Prepend, Number, IterationOf, Cast, Formats, Way, Format, Key, Extends, __Repeat, _Repeat, Repeat, Equals, Modx, Depth, MergeStyle, Anyfy, Errors, Numeric, Textual, Arrays, Maps, Structures, Abstractions, WebAssembly, BuiltInObject, ComputeRaw, ComputeFlat, ComputeDeep, Compute, Boolean, True, False, Pass, Fail, __Pick, _Pick, Pick, Union, Exclude, _Omit, Omit, AtBasic, AtStrict, AtLoose, At, KnownIterationMapKeys, NegativeIterationKeys, PositiveIterationKeys, NeutralIterationKeys, Numbers, Pos, _NumberOf, NumberOf, Length, Overwrite, Naked, __Reverse, _Reverse, Reverse, Concat, Append, PickIfEntry, ___ListOf, __ListOf, _ListOf, ListOf, Not, Has, ArrayEntry, ArrayProps, Clean, Contains, Match, _Promise, Is, And, Or, IsStringLiteral, IsNumberLiteral, Kind, IsLiteral, _Kind, Promise, Promisable, Try, Type, x, ObjectOf, BooleanOf, Xor, Class, InstanceOf, Parameters, _UnionOf, UnionOf, Prev, _IncludesDeep, IncludesDeep, Mode, Input, ComposeMultiSync, ComposeMultiAsync, ComposeListSync, ComposeListAsync, Tail, Last, Head, Return, IntersectOf, ComposeFnSync, ComposeFnAsync, Composer, Composed, Compose, NonNullable, LibStyle, PatchProp, __PatchFlat, _PatchFlat, PatchFlat, __PatchDeep, ChoosePatchDeep, _PatchDeep, PatchDeep, Patch, NonNullableFlat, NonNullableDeep, NonNullablePart, _NonNullable, GapOf, _GapsOf, GapsOf, Gaps, Curry, NoInfer, PipeMultiSync, PipeMultiAsync, PipeListSync, PipeListAsync, PipeFnSync, PipeFnAsync, Piper, Piped, Pipe, Promisify, UnCurry, Function, PixelMap, Pixel, Primitive, Value, Array, Object, JSON, _IsNegative, IsNegative, _MinusPositive, MinusPositive, _MinusNegative, MinusNegative, _Minus, __Minus, Minus, _Negate, Negate, _Absolute, Absolute, _IsZero, IsZero, _IsPositive, IsPositive, _Greater, Greater, _GreaterEq, GreaterEq, _Lower, Lower, LowerEq, UnionizeCumulatedNumberUnions, FindMaxNumberInUnion, Max, Min, _PlusPositive, PlusPositive, _PlusNegative, PlusNegative, _Plus, __Plus, Plus, RangeForth, RangeBack, __Range, _Range, Range, _OptionalKeys, OptionalKeys, MergeProp, __MergeFlat, _MergeFlat, MergeFlat, __MergeDeep, ChooseMergeDeep, _MergeDeep, MergeDeep, Merge, MergeObject, MergeList, LastIndex, OmitObject, OmitList, PickObject, PickList, ReadonlyFlat, ReadonlyDeep, ReadonlyPart, _Readonly, Readonly, ReadonlyObject, ReadonlyArrays, Record, _Update, Update, _Record_RR, _Record_RW, _Record_OR, _Record_OW, __Assign, _Assign, Assign, RequiredFlat, RequiredDeep, RequiredPart, _Required, Required, OptionalFlat, OptionalDeep, OptionalPart, _Optional, Optional, RequiredIfKeys, __AtLeast, _AtLeast, AtLeast, CompulsoryFlat, CompulsoryDeep, CompulsoryPart, _Compulsory, Compulsory, _CompulsoryKeys, CompulsoryKeys, _ExcludeMatch, ExcludeMatch, ExcludeKeys, Diff, _Strict, Strict, __Either, EitherStrict, EitherLoose, _Either, Either, _FilterKeys, FilterKeys, Filter, __Path, _Path, Path, HasPath, _SelectKeys, SelectKeys, Includes, Intersect, _IntersectMatch, IntersectMatch, IntersectKeys, _Invert, Invert, __MergeAll, _MergeAll, MergeAll, Replace, Modify, _NonNullableKeys, NonNullableKeys, Nullable, NullableFlat, NullableDeep, NullablePart, _Nullable, _NullableKeys, NullableKeys, Partial, __PatchAll, _PatchAll, PatchAll, __Paths, _Paths, Paths, UpdateFlat, __UpdateDeep, _UpdateDeep, UpdateDeep, ValidatePath, __PathValid, _PathValid, PathValid, _ReadonlyKeys, ReadonlyKeys, _Replace, _RequiredKeys, RequiredKeys, Select, UndefinableFlat, UndefinableDeep, UndefinablePart, _Undefinable, Undefinable, _UndefinableKeys, UndefinableKeys, Unionize, WritableFlat, WritableDeep, WritablePart, _Writable, Writable, _WritableKeys, WritableKeys, P, String, DropForth, DropBack, __Drop, _Drop, Drop, KeySet, Extract, UnNestLoose, Flatter, UnNestStrict, __UnNest, _UnNest, UnNest, __Flatten, _Flatten, Flatten, TakeForth, TakeBack, __Take, _Take, Take, __Group, _Group, Group, Longest, _NonNullableDeep, Pop, Remove, Shortest, __Zip, _Zip, Zip, __ZipObj, _ZipObj, ZipObj, _Merge, Test, A, Any, B, C, Community, F, I, L, M, Misc, N, O, S, T, Tuple, U

1 declare module "Iteration/Iteration" {
  ~~~~~~~

  node_modules/@types/ramda/node_modules/ts-toolbelt/out/index.d.ts:1:1
    1 declare module "Iteration/Iteration" {
      ~~~~~~~
    Conflicts are in this file.

node_modules/ts-toolbelt/out/index.d.ts:1526:22 - error TS2428: All declarations of 'Function' must have identical type parameters.

1526     export interface Function<P extends List = any, R extends any = any> {
                          ~~~~~~~~


Found 10 errors.

Expected behavior

Project builds successfully

Possible Solution

Screenshots

Additional context

@millsp
Copy link
Owner

millsp commented Dec 25, 2020

Thanks for reporting this, will fix soon!

@millsp millsp added the bug Something isn't working label Dec 25, 2020
@millsp millsp closed this as completed in f21604d Feb 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants