I am using a typescript library that does RPC calls for a blockchain. I am trying to use it in my Javascript and Vue project with Vite bundler.
I have tried install polyfills, buffer etc but somehow I still get the error mentioned below.
This is the library : https://github.com/VerusCoin/verusd-rpc-ts-client
vdxf.js:11 Uncaught ReferenceError: Buffer is not defined
at node_modules/verus-typescript-primitives/dist/constants/vdxf.js (vdxf.js:11:59)
at __require (chunk-BUSYA2B4.js?v=8da589e3:3:50)
at node_modules/verus-typescript-primitives/dist/vdxf/index.js (index.js:20:16)
at __require (chunk-BUSYA2B4.js?v=8da589e3:3:50)
at node_modules/verus-typescript-primitives/dist/vdxf/classes/Challenge.js (Challenge.js:4:13)
at __require (chunk-BUSYA2B4.js?v=8da589e3:3:50)
at node_modules/verus-typescript-primitives/dist/vdxf/classes/index.js (index.js:4:19)
at __require (chunk-BUSYA2B4.js?v=8da589e3:3:50)
at node_modules/verus-typescript-primitives/dist/index.js (index.js:22:14)
at __require (chunk-BUSYA2B4.js?v=8da589e3:3:50)
node_modules/verus-typescript-primitives/dist/constants/vdxf.js @ vdxf.js:11
__require @ chunk-BUSYA2B4.js?v=8da589e3:3
node_modules/verus-typescript-primitives/dist/vdxf/index.js @ index.js:20
__require @ chunk-BUSYA2B4.js?v=8da589e3:3
node_modules/verus-typescript-primitives/dist/vdxf/classes/Challenge.js @ Challenge.js:4
__require @ chunk-BUSYA2B4.js?v=8da589e3:3
node_modules/verus-typescript-primitives/dist/vdxf/classes/index.js @ index.js:4
__require @ chunk-BUSYA2B4.js?v=8da589e3:3
node_modules/verus-typescript-primitives/dist/index.js @ index.js:22
__require @ chunk-BUSYA2B4.js?v=8da589e3:3
node_modules/verusd-rpc-ts-client/lib/VerusdRpcInterface.js @ VerusdRpcInterface.js:16
__require @ chunk-BUSYA2B4.js?v=8da589e3:3
node_modules/verusd-rpc-ts-client/lib/index.js @ index.js:30
__require @ chunk-BUSYA2B4.js?v=8da589e3:3
(anonymous) @ index.js:33
Show 8 more frames
Show less