I’m trying to push the assetID to app.Args by encoding it to uint64 but its giving error
console.log(algosdk.encodeUint64(12345))
It was working fine recently but now it giving issues.
uint64.ts:17 Uncaught TypeError: buf.writeBigUInt64BE is not a function
at Module.encodeUint64 (uint64.ts:17:1)
at App.tsx:16:1
at invokePassiveEffectCreate (react-dom.development.js:23487:1)
at HTMLUnknownElement.callCallback (react-dom.development.js:3945:1)
at Object.invokeGuardedCallbackDev (react-dom.development.js:3994:1)
at invokeGuardedCallback (react-dom.development.js:4056:1)
at flushPassiveEffectsImpl (react-dom.development.js:23574:1)
at unstable_runWithPriority (scheduler.development.js:468:1)
at runWithPriority$1 (react-dom.development.js:11276:1)
at flushPassiveEffects (react-dom.development.js:23447:1)
at react-dom.development.js:23324:1
at workLoop (scheduler.development.js:417:1)
at flushWork (scheduler.development.js:390:1)
at MessagePort.performWorkUntilDeadline (scheduler.development.js:157:1)
So my guess is that you’re using a framework/toolchain that is somewhat not providing this function.
It looks you are using react, but which toolchain are you using:
create react app, next.js, gatsby, vite
?
Which version?
Can you show the exact error?
Are you using a framework such as create-react-app, next.js, gatsby, vite…?
Can you try to add the test suggested by @scholtz above?
Can you post your package.json (e.g., in Github gist)?
Can you create a fresh project with only algosdk and an index.js file that just test encodeUint64 and nothing else?