dai.js icon indicating copy to clipboard operation
dai.js copied to clipboard

BigNumber import Issue while running yarn build

Open viraj124 opened this issue 5 years ago • 6 comments

viraj124 avatar Sep 07 '20 07:09 viraj124

Hmm--BigNumber should come from the bignumber.js library, not our code. What is the error that you see without this change?

levity avatar Sep 09 '20 05:09 levity

Error node_modules/@makerdao/dai-plugin-mcd/typings/multicall.d.ts:98:25 - error TS2304: Cannot find name 'BigNumber'. 98 liquidationPenalty: BigNumber; ~~~~~~~~~ node_modules/@makerdao/dai-plugin-mcd/typings/multicall.d.ts:108:16 - error TS2304: Cannot find name 'BigNumber'. 108 debtFloor: BigNumber; ~~~~~~~~~ node_modules/@makerdao/dai-plugin-mcd/typings/multicall.d.ts:135:25 - error TS2304: Cannot find name 'BigNumber'. 135 liquidationPenalty: BigNumber; ~~~~~~~~~ node_modules/@makerdao/dai-plugin-mcd/typings/multicall.d.ts:140:28 - error TS2304: Cannot find name 'BigNumber'. 140 priceWithSafetyMargin: BigNumber; ~~~~~~~~~ node_modules/@makerdao/dai-plugin-mcd/typings/multicall.d.ts:145:16 - error TS2304: Cannot find name 'BigNumber'. 145 debtFloor: BigNumber; ~~~~~~~~~ node_modules/@makerdao/dai-plugin-mcd/typings/multicall.d.ts:157:52 - error TS2304: Cannot find name 'BigNumber'. 157 debtScalingFactor(collateralTypeName: string): BigNumber; ~~~~~~~~~ node_modules/@makerdao/dai-plugin-mcd/typings/multicall.d.ts:162:56 - error TS2304: Cannot find name 'BigNumber'. 162 priceWithSafetyMargin(collateralTypeName: string): BigNumber; ~~~~~~~~~ node_modules/@makerdao/dai-plugin-mcd/typings/multicall.d.ts:172:44 - error TS2304: Cannot find name 'BigNumber'. 172 debtFloor(collateralTypeName: string): BigNumber; ~~~~~~~~~ node_modules/@makerdao/dai-plugin-mcd/typings/multicall.d.ts:192:8 - error TS2304: Cannot find name 'BigNumber'. 192 ): BigNumber; ~~~~~~~~~ node_modules/@makerdao/dai-plugin-mcd/typings/multicall.d.ts:201:8 - error TS2304: Cannot find name 'BigNumber'. 201 ): BigNumber; ~~~~~~~~~ node_modules/@makerdao/dai-plugin-mcd/typings/multicall.d.ts:210:8 - error TS2304: Cannot find name 'BigNumber'. 210 ): BigNumber; ~~~~~~~~~ node_modules/@makerdao/dai-plugin-mcd/typings/multicall.d.ts:235:52 - error TS2304: Cannot find name 'BigNumber'. 235 maxAuctionLotSize(collateralTypeName: string): BigNumber; ~~~~~~~~~

viraj124 avatar Sep 09 '20 06:09 viraj124

while running yarn build without this

viraj124 avatar Sep 09 '20 06:09 viraj124

Hmm--BigNumber should come from the bignumber.js library, not our code. What is the error that you see without this change?

ideally yes, but not sure why it doesn't pick from there

viraj124 avatar Sep 09 '20 06:09 viraj124

Error node_modules/@makerdao/dai-plugin-mcd/typings/multicall.d.ts:98:25 - error TS2304: Cannot find name 'BigNumber'. 98 liquidationPenalty: BigNumber;

node_modules/@makerdao/dai-plugin-mcd/typings/multicall.d.ts:108:16 - error TS2304: Cannot find name 'BigNumber'.
108 debtFloor: BigNumber;

node_modules/@makerdao/dai-plugin-mcd/typings/multicall.d.ts:135:25 - error TS2304: Cannot find name 'BigNumber'. 135 liquidationPenalty: BigNumber;

node_modules/@makerdao/dai-plugin-mcd/typings/multicall.d.ts:140:28 - error TS2304: Cannot find name 'BigNumber'.
140 priceWithSafetyMargin: BigNumber;

node_modules/@makerdao/dai-plugin-mcd/typings/multicall.d.ts:145:16 - error TS2304: Cannot find name 'BigNumber'. 145 debtFloor: BigNumber;

node_modules/@makerdao/dai-plugin-mcd/typings/multicall.d.ts:157:52 - error TS2304: Cannot find name 'BigNumber'.
157 debtScalingFactor(collateralTypeName: string): BigNumber;

node_modules/@makerdao/dai-plugin-mcd/typings/multicall.d.ts:162:56 - error TS2304: Cannot find name 'BigNumber'. 162 priceWithSafetyMargin(collateralTypeName: string): BigNumber;

node_modules/@makerdao/dai-plugin-mcd/typings/multicall.d.ts:172:44 - error TS2304: Cannot find name 'BigNumber'.
172 debtFloor(collateralTypeName: string): BigNumber;

node_modules/@makerdao/dai-plugin-mcd/typings/multicall.d.ts:192:8 - error TS2304: Cannot find name 'BigNumber'. 192 ): BigNumber;

node_modules/@makerdao/dai-plugin-mcd/typings/multicall.d.ts:201:8 - error TS2304: Cannot find name 'BigNumber'.
201 ): BigNumber;

node_modules/@makerdao/dai-plugin-mcd/typings/multicall.d.ts:210:8 - error TS2304: Cannot find name 'BigNumber'. 210 ): BigNumber;

node_modules/@makerdao/dai-plugin-mcd/typings/multicall.d.ts:235:52 - error TS2304: Cannot find name 'BigNumber'.
235 maxAuctionLotSize(collateralTypeName: string): BigNumber;

I have the same problem. Both importing BigNumber from 'bignumber.js' or declaring a BigNumber interface works for me to solve this problem. However, it may be better to import from 'bignumber.js' as it should go from there. Though this is a purely ts error.

kushkamisha avatar Apr 02 '21 09:04 kushkamisha

will this come under some sort of bug bounty if this get's merged?

viraj124 avatar Apr 02 '21 11:04 viraj124