ccxt icon indicating copy to clipboard operation
ccxt copied to clipboard

tsc command fails (typescript v4.7.4) (ccxt v4.2.96)

Open sainiankit opened this issue 10 months ago • 10 comments

Operating System

Mac OS / Linux

Programming Languages

JavaScript

CCXT Version

4.2.96

Description

tsc command in the parent project fails with the following error:

Code

  > tsc

node_modules/ccxt/js/src/base/ws/Cache.d.ts:1:31 - error TS2314: Generic type 'Array<T>' requires 1 type argument(s).

1 interface CustomArray extends Array {
                                ~~~~~

node_modules/ccxt/js/src/base/ws/OrderBookSide.d.ts:7:54 - error TS2314: Generic type 'IOrderBookSide<T>' requires 1 type argument(s).

7 declare class OrderBookSide extends Array implements IOrderBookSide {
                                                       ~~~~~~~~~~~~~~

node_modules/ccxt/js/src/base/ws/OrderBookSide.d.ts:14:5 - error TS2416: Property 'store' in type 'CountedOrderBookSide' is not assignable to the same property in base type 'OrderBookSide'.
  Type '(price: any, size: any, count: any) => void' is not assignable to type '(price: any, size: any) => void'.

14     store(price: any, size: any, count: any): void;
       ~~~~~

node_modules/ccxt/js/src/base/ws/OrderBookSide.d.ts:17:61 - error TS2314: Generic type 'IOrderBookSide<T>' requires 1 type argument(s).

17 declare class IndexedOrderBookSide extends Array implements IOrderBookSide {
                                                               ~~~~~~~~~~~~~~


Found 4 errors in 2 files.

Errors  Files
     1  node_modules/ccxt/js/src/base/ws/Cache.d.ts:1
     3  node_modules/ccxt/js/src/base/ws/OrderBookSide.d.ts:7

sainiankit avatar Apr 14 '24 16:04 sainiankit

Hello @sainiankit, what's the tsc version used? Can you please share a small reproducible project?

carlosmiei avatar Apr 14 '24 16:04 carlosmiei

Hi @carlosmiei !

Typescript version in the parent project is 4.8.4. (I have also tried 4.7.4, but no luck). I've been using ccxt for a while. tsc runs fine for me till ccxt version 4.2.45, as soon as I update it to 4.2.46. I start to receive this error after tsc is run.

> tsc

node_modules/ccxt/js/src/base/ws/Cache.d.ts:1:31 - error TS2314: Generic type 'Array<T>' requires 1 type argument(s).

1 interface CustomArray extends Array {
                                ~~~~~

Found 1 error in node_modules/ccxt/js/src/base/ws/Cache.d.ts:1

Let me create a reproducible project and share.

sainiankit avatar Apr 14 '24 16:04 sainiankit

@sainiankit Thank you,

I'm just a bit lost because we use typescript 4.74 and we don't see that error, but we will try to update it and check that again.

carlosmiei avatar Apr 14 '24 16:04 carlosmiei

Here is a simplified reproducible project: https://github.com/sainiankit/ccxt-test

Steps to reproduce:

1.) npm install

2.) npm run build
> [email protected] build
> tsc

node_modules/ccxt/js/src/base/ws/Cache.d.ts:1:31 - error TS2314: Generic type 'Array<T>' requires 1 type argument(s).

1 interface CustomArray extends Array {
                                ~~~~~

node_modules/ccxt/js/src/base/ws/OrderBookSide.d.ts:7:54 - error TS2314: Generic type 'IOrderBookSide<T>' requires 1 type argument(s).

7 declare class OrderBookSide extends Array implements IOrderBookSide {
                                                       ~~~~~~~~~~~~~~

node_modules/ccxt/js/src/base/ws/OrderBookSide.d.ts:14:5 - error TS2416: Property 'store' in type 'CountedOrderBookSide' is not assignable to the same property in base type 'OrderBookSide'.
  Type '(price: any, size: any, count: any) => void' is not assignable to type '(price: any, size: any) => void'.

14     store(price: any, size: any, count: any): void;
       ~~~~~

node_modules/ccxt/js/src/base/ws/OrderBookSide.d.ts:17:61 - error TS2314: Generic type 'IOrderBookSide<T>' requires 1 type argument(s).

17 declare class IndexedOrderBookSide extends Array implements IOrderBookSide {
                                                               ~~~~~~~~~~~~~~


Found 4 errors in 2 files.

Errors  Files
     1  node_modules/ccxt/js/src/base/ws/Cache.d.ts:1
     3  node_modules/ccxt/js/src/base/ws/OrderBookSide.d.ts:7

sainiankit avatar Apr 14 '24 17:04 sainiankit

@sainiankit Thank you we will check it out.

carlosmiei avatar Apr 15 '24 14:04 carlosmiei

same issue here, any updates for this issue?

0xchanning avatar May 06 '24 06:05 0xchanning

same issue

PRICEKRAKEN avatar May 16 '24 16:05 PRICEKRAKEN

same issue

dorienh avatar May 21 '24 06:05 dorienh

@sainiankit @0xchanning @PRICEKRAKEN @dorienh We will fix it shortly, sorry for the delay.

carlosmiei avatar May 21 '24 09:05 carlosmiei

@sainiankit @0xchanning @PRICEKRAKEN @dorienh we just released a new version (4.3.29) with the fix.

Can you please update your ccxt version and try again?

carlosmiei avatar May 21 '24 15:05 carlosmiei