jito-labs / jito-ts

Jito Typescript SDK
Other
92 stars 50 forks source link

TypeError: The "original" argument must be of type Function | @grpc/grpc-js/build/src/resolver-dns.js #28

Open dinhtheloc opened 3 months ago

dinhtheloc commented 3 months ago

I am currently using jito-ts for my React TypeScript project. When I start importing { searcherClient } from './jito/sdk/block-engine/searcher', I encounter the following error:

TypeError: The "original" argument must be of type Function at Object.promisify (http://localhost:3000/node_modules/.vite/deps/chunk-3OND6XRJ.js?v=90d6346d:2055:15) at node_modules/@grpc/grpc-js/build/src/resolver-dns.js (http://localhost:3000/node_modules/.vite/deps/@grpc_grpc-js.js?v=dd2ab8cd:9845:34) at __require2 (http://localhost:3000/node_modules/.vite/deps/chunk-KK4SFAKU.js?v=90d6346d:27:50) at node_modules/@grpc/grpc-js/build/src/http_proxy.js (http://localhost:3000/node_modules/.vite/deps/@grpc_grpc-js.js?v=dd2ab8cd:10088:26) at __require2 (http://localhost:3000/node_modules/.vite/deps/chunk-KK4SFAKU.js?v=90d6346d:27:50) at node_modules/@grpc/grpc-js/build/src/transport.js (http://localhost:3000/node_modules/.vite/deps/@grpc_grpc-js.js?v=dd2ab8cd:10773:24) at __require2 (http://localhost:3000/node_modules/.vite/deps/chunk-KK4SFAKU.js?v=90d6346d:27:50) at node_modules/@grpc/grpc-js/build/src/subchannel-pool.js (http://localhost:3000/node_modules/.vite/deps/@grpc_grpc-js.js?v=dd2ab8cd:11253:23) at __require2 (http://localhost:3000/node_modules/.vite/deps/chunk-KK4SFAKU.js?v=90d6346d:27:50) at node_modules/@grpc/grpc-js/build/src/internal-channel.js (http://localhost:3000/node_modules/.vite/deps/@grpc_grpc-js.js?v=dd2ab8cd:13056:29)

This error originates from TypeScript due to passing the wrong type of Function. I tried using it with React JS and it works very well. How can I fix this error with TypeScript?

"typescript": "^5.2.2", "vite": "^5.2.0", jito-ts: lastest version.