ava-labs / avalanchejs

The Avalanche Platform JavaScript Library
Other
324 stars 164 forks source link

Starting 3.2.6 version it's unable to use avalanchejs with typesctipt #229

Closed APshenkin closed 3 years ago

APshenkin commented 3 years ago

building with 3.2.6/3.3.0/3.4.0/3.4.1/3.5.0/

node_modules/avalanche/dist/apis/index/api.d.ts:7:123 - error TS2307: Cannot find module 'src/common/interfaces' or its corresponding type declarations.

7 import { GetLastAcceptedResponse, GetContainerByIndexResponse, GetContainerByIDResponse, GetContainerRangeResponse } from 'src/common/interfaces';
                                                                                                                            ~~~~~~~~~~~~~~~~~~~~~~~

node_modules/avalanche/dist/apis/info/api.d.ts:8:31 - error TS2307: Cannot find module 'src/common/interfaces' or its corresponding type declarations.

8 import { PeersResponse } from 'src/common/interfaces';

building with 3.5.1/3.5.2/3.6.1

node_modules/avalanche/dist/apis/index/api.d.ts:7:123 - error TS2307: Cannot find module 'src/common/interfaces' or its corresponding type declarations.

7 import { GetLastAcceptedResponse, GetContainerByIndexResponse, GetContainerByIDResponse, GetContainerRangeResponse } from 'src/common/interfaces';
                                                                                                                            ~~~~~~~~~~~~~~~~~~~~~~~

node_modules/avalanche/dist/apis/info/api.d.ts:8:31 - error TS2307: Cannot find module 'src/common/interfaces' or its corresponding type declarations.

8 import { PeersResponse } from 'src/common/interfaces';
                                ~~~~~~~~~~~~~~~~~~~~~~~

node_modules/avalanche/dist/apis/platformvm/api.d.ts:14:40 - error TS2307: Cannot find module 'src/common' or its corresponding type declarations.

14 import { GetRewardUTXOsResponse } from 'src/common';
                                          ~~~~~~~~~~~~

node_modules/avalanche/dist/apis/platformvm/api.d.ts:15:34 - error TS2307: Cannot find module 'src/common' or its corresponding type declarations.

15 import { GetStakeResponse } from 'src/common';
                                    ~~~~~~~~~~~~

node_modules/avalanche/dist/common/interfaces.d.ts:5:23 - error TS2688: Cannot find type definition file for 'bn.js'.

5 /// <reference types="bn.js" />
                        ~~~~~

node_modules/avalanche/dist/common/interfaces.d.ts:7:20 - error TS2307: Cannot find module 'src' or its corresponding type declarations.

7 import { BN } from 'src';
                     ~~~~~

node_modules/avalanche/dist/common/interfaces.d.ts:8:36 - error TS2307: Cannot find module 'src/apis/platformvm' or its corresponding type declarations.

8 import { TransferableOutput } from 'src/apis/platformvm';
                                     ~~~~~~~~~~~~~~~~~~~~~

So last 8 versions can't be used with Typescript types.

jpop32 commented 3 years ago

How do you run/compile the project?

cgcardona commented 3 years ago

Resolved in v3.6.2

https://github.com/ava-labs/avalanchejs/releases/tag/v3.6.2