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

TS7016: Could not find a declaration file for module 'big.js'

Open shlomich opened this issue 3 years ago • 2 comments

Hiya, when running the project I am running into this problem since there is no declaration file.

TS7016: Could not find a declaration file for module 'big.js'. 'C:/Users/rrrr/Desktop/rrrr/rrrr/git/rrrr/node_modules/big.js/big.js' implicitly has an 'any' type. Try npm i --save-dev @types/big.js if it exists or add a new declaration (.d.ts) file containing declare module 'big.js'; 2 | import {pg} from 'pg' 3 | import type {PairInfo} from '@rrrr/rrrr/types';

4 | import Big from 'big.js'

Ofcourse // @ts-ignore fixes it but I was wondering if there's something you can do in order to get it fixed. Thanks :)

Should I use your other lib? https://github.com/MikeMcl/bignumber.js ?

shlomich avatar Jun 18 '22 23:06 shlomich

I have only came across this because I have faced a "original: TypeError: (0 , big_js_1.default)(...).toNumber is not a function" :(.

shlomich avatar Jun 18 '22 23:06 shlomich

As per the README:

$ npm install --save-dev @types/big.js

MikeMcl avatar Jun 19 '22 23:06 MikeMcl