Buffer not defined
Hi guys, I'm developing a mobile app with a Convex backend and have written functions using the bitcoinjs-lib library. When pushing these functions, I encounter a 'Buffer undefined' error.
I've tried adding import
to the top of my file, which resolves the issue without using bitcoin.intEccLib. However, I need to initialize a PSBT for my application.
Is there a workaround for this issue?
2 Replies
Thanks for posting in <#1088161997662724167>.
Reminder: If you have a Convex Pro account, use the Convex Dashboard to file support tickets.
- Provide context: What are you trying to achieve, what is the end-user interaction, what are you seeing? (full error message, command output, etc.)
- Use search.convex.dev to search Docs, Stack, and Discord all at once.
- Additionally, you can post your questions in the Convex Community's <#1228095053885476985> channel to receive a response from AI.
- Avoid tagging staff unless specifically instructed.
Thank you!
What type of function is trying to use that library? If it's a query or mutation, it's not going to work. Only actions support NPM libraries, and only with the
"use node"
directive at the top of the file. More info on that can be found here: https://docs.convex.dev/functions/actions#calling-third-party-apis-and-using-npm-packagesActions | Convex Developer Hub
Actions can call third party services to do things such as processing a payment